<!DOCTYPE html>
<html>
<!--
    PC-BASIC documentation
    Copyright (c) 2014-2015 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->
<head>
    <meta charset="utf-8">
    <!--[if gt IE 8]><!-->
    <style id="/home/rob/Projects/basic-project/pc-basic/docsrc/doc.css">
/*!
    PC-BASIC documentation
    Copyright (c) 2014-2015 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
*/

html {
    background-color: white;
    overflow-x: hidden;
}

code,
kbd,
pre,
samp {
  font-family: monospace, monospace;
  font-size: 1rem;
}

hr {
    display: none;
}

.block {
    display: block;
}

figure, .scrollable, pre, code.block, samp.block {
    max-width: 45rem;
    width: 100%;
    overflow-x: auto;
}

figure {
    margin: 0;
    padding: 0;
}

article, header, nav.toc, footer {
    margin-left: 0;
    margin-right: 0;
    max-width: 45em;
    max-width: 45em;
    background-color: white;
    padding: 1em;
    line-height: 1.4em;
    font-family: sans-serif;
}

/* screenshot image */
img {
    max-width: 45em;
    width: 100%;
}

nav.toc {
    line-height: 2em;
}

nav.toc li {
    border-top: 1px solid #eeeeee;
    list-style: none;
    padding-left: 0;
}
nav.toc ul {
    padding-left: 0.8em;
    padding-right: 0.8em;
}

a, nav.toc a:visited {
    color: inherit;
}

nav.toc a, nav.toc a:visited {
    text-decoration: none;
}

nav.toc>ul  {
    font-weight: bold;
    color: black;
}
nav.toc>ul>li>ul  {
    font-weight: normal;
}
nav.toc>ul>li>ul>li>ul  {
    color: #444444;
}
nav.toc>ul>li>ul>li>ul>li>ul  {
    color: grey;
}
nav.toc a:hover {
    color: black;
    text-decoration: underline;
}
h1, h2, h3 {
    font-size: 1.3em;
    background: #000044;
    padding: 0.2em;
    color: white;
}
h3 {
    background: #444444;
    margin-top: 3rem;
}

h4 {
    margin-top: 2rem;
    margin-bottom: 0;
    font-size: 1.2em;
    border-bottom: 2px solid #333333;
}

h5 {
    margin-bottom: 0em;
    font-size: 1.1em;
}

h6 {
    margin-top: 0em;
    margin-bottom: 0em;
    font-weight: 600;
}


ul {
    margin-top: 0em;
    padding-left: 1em;
}

/* compact def lists */
dl.compact {
    display: inline-block;
    width: 100%;
}
.compact dt {
    float: left;
    clear: left;
    width: 6em;
    margin: 0;
    margin-right: 1em;
}
.compact dd {
    float: left;
    clear: right;
    margin: 0;
}

/* compact list */
.compact li {
    display: inline-block;
    width: 5em;
}

.compact10 li {
    display: inline-block;
    width: 10em;
}

/* horizontal list */
.horizontal {
    padding-left: 0;
}

.horizontal li {
    display: inline-block;
}

p {
    margin-top: 0.5em;
    margin-bottom: 1em;
}

dl {
    margin-top: 0.5em;
    margin-bottom: 1em;
}

dt {
    font-weight: bold;
}

dd {
    margin-bottom: 1em;
    padding-right: 1em;
}

code, samp {
    font-size: 0.8em;
    word-break: keep-all;
    /*white-space: nowrap;*/
}

dd>code, p>code, dt>code, li>code,
dd>samp, p>samp, dt>samp, li>samp
{
    background-color: #eeeeff;
    border-radius: 0.2em;
    padding: 0.1em 0.5em 0.1em 0.5em;
}

th {
    text-align: left;
    background-color: #ccccdd;
}

table {
    font-size: 1em;
    margin-top: 1em;
    margin-bottom: 1em;
    line-height: 140%;
    border-bottom: 1px dotted lightblue;
    width: 100%;
    max-width: 45em;
}

tr:nth-child(odd)		{ background-color:#eeeeff; }
tr:nth-child(even)		{ background-color:#ffffff; }

td, th {
    padding-left: 0.5em;
    padding-right: 0.5em;
    vertical-align: top;
}

kbd {
    font-size: 0.7em;
    word-break: keep-all;
    white-space: nowrap;
    background-color: gray;
    color: white;
    border-radius: 0.2em;
    padding: 0.1em 0.5em 0.1em 0.5em;
    margin: 0px 1px 0px 1px;
}
pre, code.block, samp.block {
    font-size: 0.8em;
    background-color: #eeeeff;
    margin-top: 0.5em;
    border-top: 1px dotted;
    border-bottom: 1px dotted;
    padding: 0.1em 0.5em 0.1em 0.5em;
}
dt code {
    font-weight: normal;
}

/* tablets and desktops */

@media (min-width: 55em) {
    /* header on offline docs */

    .standalone header {
        backgound: yellow;
        position:fixed;
        z-index:4;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 3.2rem;
        background: #0000aa;
        border-bottom: 1em solid grey;
        font-family: sans-serif;
        margin: 0;
        padding: 0;
    }
    .standalone header h1, .standalone header h2, .standalone header small {
        background: none;
        color: white;
        margin: 0.5rem 0 0 1rem;
        display: inline-block;
    }
    .standalone header small {
        color: grey;
        float: right;
        margin: 0.7rem 1rem 0 0;
    }

    /* push link target below fixed menu */
    :target::before {
        display: block;
        content: "";
        height: 5rem;
        background: white;
        /* we need to cut off the padding to :target
           so we don't get a box. this compensates a bot */
        margin-bottom: 0.2em;
    }
    :target {
        margin-top: -3rem;
        padding-left: 0;
        padding-right: 0;
        padding-top: 0;
    }

    /*
        we need the space in between or the ::before block will
        go over the last bit of the previous article. Somehow, fortunately,
        doesn't happen with sections... */
    article, header, footer {
        margin-top: 4rem;
    }

    article, header, footer {
        /* make space for scroll-under menu */
        position: relative;
        margin-left: 20rem;
        line-height: 1.5em;
    }

    nav.toc {
        position: fixed;
        overflow-y: scroll;
        left: 0;
        top: 0;
        padding: 5rem 1em 0 1em;
        width: 18rem;
        background: #000044;
        height: 90vh;
        line-height: 1.4em;
    }
    nav.toc h2 {
        display: none;
    }
    nav.toc a:hover {
        color: white;
    }

    nav.toc li {
        border: none;
    }
    nav.toc ul  {
        padding-right: none;
    }

    nav.toc>ul  {
        color: white;
    }
    nav.toc>ul>li>ul {
        color: lightsteelblue;
    }
    nav.toc>ul>li>ul>li>ul  {
        color: steelblue;
    }



}

    </style>
    <!--<![endif]-->
    <title>PC-BASIC Documentation</title>
</head>
<body class="standalone">
<header>
<h1>PC-BASIC 15.9.dev1 documentation</h1>
<small>Documentation compiled on 2015-12-22 07:46:48.</small>
</header>
<nav class="toc">
    <h2 id="toc">Table of Contents</h2>

            <ul>
                <li><a href="#pc-basic">Overview</a></li>
                <li><a href="#quick-start-guide">Quick Start Guide</a>
                    <ul>
                        <li><a href="#installation">Installation</a></li>
                        <li><a href="#usage-essentials">Usage essentials</a></li>
                        <li><a href="#basic-basic-commands">Basic BASIC commands</a></li>
                        <li><a href="#get-basic-programs">Get BASIC programs</a></li>
                    </ul>
                </li>
                <li><a href="#using">User's guide</a>
                    <ul>
                        <li><a href="#workenv">The working environment</a>
                            <ul>
                                <li><a href="#special-keys">Special keys</a></li>
                                <li><a href="#shortcuts">Keyboard shortcuts</a></li>
                                <li><a href="#alternative-keys">Alternative keys</a></li>
                                <li><a href="#clipboard-operations">Clipboard operations</a></li>
                                <li><a href="#emulator-keys">Emulator control keys</a></li>
                            </ul>
                        </li>
                        <li><a href="#programs">BASIC programs</a>
                            <ul>
                                <li><a href="#eightpointthree">File names on disk</a></li>
                                <li><a href="#mounting">Accessing your drives</a></li>
                                <li><a href="#program-files">Compatible BASIC files</a></li>
                                <li><a href="#packages">Packages</a></li>
                                <li><a href="#security">Security</a></li>
                            </ul>
                        </li>
                        <li><a href="#devices">Devices</a>
                            <ul>
                                <li><a href="#printing">Printing</a></li>
                                <li><a href="#ports">Serial and parallel ports</a></li>
                                <li><a href="#cassette">Cassette interface and BASICODE</a></li>
                            </ul>
                        </li>
                        <li><a href="#interface">Changing the interface</a>
                            <ul>
                                <li><a href="#presets">Emulation targets</a></li>
                                <li><a href="#codepages">Codepages</a></li>
                                <li><a href="#fonts">Fonts</a></li>
                                <li><a href="#redirecting">Redirecting I/O</a></li>
                                <li><a href="#cli">Command-line interface</a></li>
                                <li><a href="#curses">Text-based interface</a></li>
                            </ul>
                        </li>
                        <li><a href="#gwbasic">Differences with GW-BASIC</a>
                            <ul>
                                <li><a href="#gwbasic-language">Language differences</a></li>
                                <li><a href="#gwbasic-devices">Devices</a></li>
                                <li><a href="#gwbasic-options">Command-line options</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li><a href="#settings">Settings and options</a>
                    <ul>
                        <li><a href="#synopsis">Synopsis</a></li>
                        <li><a href="#parameters">Positional arguments</a></li>
                        <li><a href="#options">Options</a></li>
                        <li><a href="#examples">Examples</a></li>
                    </ul>
                </li>
                <li><a href="#reference">Language reference</a>
                    <ul>
                        <li><a href="#metasyntax">Metasyntax</a></li>
                        <li><a href="#literals">Literals</a></li>
                        <li><a href="#variables">Variables</a></li>
                        <li><a href="#arrays">Arrays</a></li>
                        <li><a href="#types">Types</a>
                            <ul>
                                <li><a href="#typechars">Type characters</a></li>
                                <li><a href="#limits">Machine limits</a></li>
                            </ul>
                        </li>
                        <li><a href="#operators">Operators</a>
                            <ul>
                                <li><a href="#order-of-preference">Order of precedence</a></li>
                                <li><a href="#math-operators">Mathematical operators</a></li>
                                <li><a href="#relational-operators">Relational operators</a></li>
                                <li><a href="#boolean-operators">Bitwise operators</a></li>
                                <li><a href="#string-operators">String operators</a></li>
                            </ul>
                        </li>
                        <li><a href="#statements-functions">Statements and functions</a>
                            <ul>
                                <li><a href="#ABS"><code>ABS</code> function</a></li>
                                <li><a href="#ASC"><code>ASC</code> function</a></li>
                                <li><a href="#ATN"><code>ATN</code> function</a></li>
                                <li><a href="#AUTO"><code>AUTO</code> statement</a></li>
                                <li><a href="#BEEP"><code>BEEP</code> statement</a></li>
                                <li><a href="#BEEP-switch"><code>BEEP</code> statement (switch)</a></li>
                                <li><a href="#BLOAD"><code>BLOAD</code> statement</a></li>
                                <li><a href="#BSAVE"><code>BSAVE</code> statement</a></li>
                                <li><a href="#CALL"><code>CALL</code> statement</a></li>
                                <li><a href="#CALLS"><code>CALLS</code> statement</a></li>
                                <li><a href="#CDBL"><code>CDBL</code> function</a></li>
                                <li><a href="#CHAIN"><code>CHAIN</code> statement</a></li>
                                <li><a href="#CHDIR"><code>CHDIR</code> statement</a></li>
                                <li><a href="#CHR%24"><code>CHR$</code> function</a></li>
                                <li><a href="#CINT"><code>CINT</code> function</a></li>
                                <li><a href="#CIRCLE"><code>CIRCLE</code> statement</a></li>
                                <li><a href="#CLEAR"><code>CLEAR</code> statement</a></li>
                                <li><a href="#CLOSE"><code>CLOSE</code> statement</a></li>
                                <li><a href="#CLS"><code>CLS</code> statement</a></li>
                                <li><a href="#COLOR"><code>COLOR</code> statement (text mode)</a></li>
                                <li><a href="#COLOR-1"><code>COLOR</code> statement (<code>SCREEN 1</code>)</a></li>
                                <li><a href="#COLOR-3-9"><code>COLOR</code> statement (<code>SCREEN 3&#8212;9</code>)</a></li>
                                <li><a href="#COM"><code>COM</code> statement</a></li>
                                <li><a href="#COMMON"><code>COMMON</code> statement</a></li>
                                <li><a href="#CONT"><code>CONT</code> statement</a></li>
                                <li><a href="#COS"><code>COS</code> function</a></li>
                                <li><a href="#CSNG"><code>CSNG</code> function</a></li>
                                <li><a href="#CSRLIN"><code>CSRLIN</code> function</a></li>
                                <li><a href="#CVI"><code>CVI</code> function</a></li>
                                <li><a href="#CVS"><code>CVS</code> function</a></li>
                                <li><a href="#CVD"><code>CVD</code> function</a></li>
                                <li><a href="#DATA"><code>DATA</code> statement</a></li>
                                <li><a href="#DATE%24"><code>DATE$</code> function</a></li>
                                <li><a href="#DATE%24-statement"><code>DATE$</code> statement</a></li>
                                <li><a href="#DEF-FN"><code>DEF FN</code> statement</a></li>
                                <li><a href="#DEFINT"><code>DEFINT</code>, <code>DEFDBL</code>, <code>DEFSNG</code>, <code>DEFSTR</code> statements</a></li>
                                <li><a href="#DEF-SEG"><code>DEF SEG</code> statement</a></li>
                                <li><a href="#DEF-USR"><code>DEF USR</code> statement</a></li>
                                <li><a href="#DELETE"><code>DELETE</code> statement</a></li>
                                <li><a href="#DIM"><code>DIM</code> statement</a></li>
                                <li><a href="#DRAW"><code>DRAW</code> statement</a></li>
                                <li><a href="#EDIT"><code>EDIT</code> statement</a></li>
                                <li><a href="#ELSE"><code>ELSE</code> statement</a></li>
                                <li><a href="#END"><code>END</code> statement</a></li>
                                <li><a href="#ENVIRON"><code>ENVIRON</code> statement</a></li>
                                <li><a href="#ENVIRON%24"><code>ENVIRON$</code> function</a></li>
                                <li><a href="#EOF"><code>EOF</code> function</a></li>
                                <li><a href="#ERASE"><code>ERASE</code> statement</a></li>
                                <li><a href="#ERDEV"><code>ERDEV</code> function</a></li>
                                <li><a href="#ERDEV%24"><code>ERDEV$</code> function</a></li>
                                <li><a href="#ERL"><code>ERL</code> function</a></li>
                                <li><a href="#ERR"><code>ERR</code> function</a></li>
                                <li><a href="#ERROR"><code>ERROR</code> statement</a></li>
                                <li><a href="#EXP"><code>EXP</code> function</a></li>
                                <li><a href="#EXTERR"><code>EXTERR</code> function</a></li>
                                <li><a href="#FIELD"><code>FIELD</code> statement</a></li>
                                <li><a href="#FILES"><code>FILES</code> statement</a></li>
                                <li><a href="#FIX"><code>FIX</code> function</a></li>
                                <li><a href="#FN"><code>FN</code> function</a></li>
                                <li><a href="#FOR"><code>FOR</code> statement</a></li>
                                <li><a href="#FRE"><code>FRE</code> function</a></li>
                                <li><a href="#GET-files"><code>GET</code> statement (files)</a></li>
                                <li><a href="#GET-serial"><code>GET</code> statement (communications)</a></li>
                                <li><a href="#GET-graphics"><code>GET</code> statement (graphics)</a></li>
                                <li><a href="#GOSUB"><code>GOSUB</code> statement</a></li>
                                <li><a href="#GOTO"><code>GOTO</code> statement</a></li>
                                <li><a href="#HEX%24"><code>HEX$</code> function</a></li>
                                <li><a href="#IF"><code>IF</code> statement</a></li>
                                <li><a href="#INKEY%24"><code>INKEY$</code> function</a></li>
                                <li><a href="#INP"><code>INP</code> function</a></li>
                                <li><a href="#INPUT"><code>INPUT</code> statement (console)</a></li>
                                <li><a href="#INPUT-file"><code>INPUT</code> statement (devices and files)</a></li>
                                <li><a href="#INPUT%24"><code>INPUT$</code> function</a></li>
                                <li><a href="#INSTR"><code>INSTR</code> function</a></li>
                                <li><a href="#INT"><code>INT</code> function</a></li>
                                <li><a href="#IOCTL"><code>IOCTL</code> statement</a></li>
                                <li><a href="#IOCTL%24"><code>IOCTL$</code> function</a></li>
                                <li><a href="#KEY-list"><code>KEY</code> statement (function-key macro list)</a></li>
                                <li><a href="#KEY-def"><code>KEY</code> statement (function-key macro definition)</a></li>
                                <li><a href="#KEY-event"><code>KEY</code> statement (event-trapping switch)</a></li>
                                <li><a href="#KEY-event-def"><code>KEY</code> statement (event-trapping key definition)</a></li>
                                <li><a href="#KILL"><code>KILL</code> statement</a></li>
                                <li><a href="#LCOPY"><code>LCOPY</code> statement</a></li>
                                <li><a href="#LEFT%24"><code>LEFT$</code> function</a></li>
                                <li><a href="#LEN"><code>LEN</code> function</a></li>
                                <li><a href="#LET"><code>LET</code> statement</a></li>
                                <li><a href="#LINE"><code>LINE</code> statement</a></li>
                                <li><a href="#LINE-INPUT"><code>LINE INPUT</code> statement (console)</a></li>
                                <li><a href="#LINE-INPUT-file"><code>LINE INPUT</code> statement (files)</a></li>
                                <li><a href="#LIST"><code>LIST</code> statement</a></li>
                                <li><a href="#LLIST"><code>LLIST</code> statement</a></li>
                                <li><a href="#LOAD"><code>LOAD</code> statement</a></li>
                                <li><a href="#LOC"><code>LOC</code> function</a></li>
                                <li><a href="#LOCATE"><code>LOCATE</code> statement</a></li>
                                <li><a href="#LOCK"><code>LOCK</code> statement</a></li>
                                <li><a href="#LOF"><code>LOF</code> function</a></li>
                                <li><a href="#LOG"><code>LOG</code> function</a></li>
                                <li><a href="#LPOS"><code>LPOS</code> function</a></li>
                                <li><a href="#LPRINT"><code>LPRINT</code> statement</a></li>
                                <li><a href="#LSET"><code>LSET</code> and <code>RSET</code> statements</a></li>
                                <li><a href="#MERGE"><code>MERGE</code> statement</a></li>
                                <li><a href="#MID%24"><code>MID$</code> function</a></li>
                                <li><a href="#MID%24-statement"><code>MID$</code> statement</a></li>
                                <li><a href="#MKDIR"><code>MKDIR</code> statement</a></li>
                                <li><a href="#MKD%24"><code>MKD$</code> function</a></li>
                                <li><a href="#MKI%24"><code>MKI$</code> function</a></li>
                                <li><a href="#MKS%24"><code>MKS$</code> function</a></li>
                                <li><a href="#MOTOR"><code>MOTOR</code> statement</a></li>
                                <li><a href="#NAME"><code>NAME</code> statement</a></li>
                                <li><a href="#NEW"><code>NEW</code> statement</a></li>
                                <li><a href="#NEXT"><code>NEXT</code> statement</a></li>
                                <li><a href="#NOISE"><code>NOISE</code> statement</a></li>
                                <li><a href="#OCT%24"><code>OCT$</code> function</a></li>
                                <li><a href="#ON-jump"><code>ON</code> statement (calculated jump)</a></li>
                                <li><a href="#ON-event"><code>ON</code> statement (event trapping)</a></li>
                                <li><a href="#ON-ERROR"><code>ON ERROR</code> statement</a></li>
                                <li><a href="#OPEN"><code>OPEN</code> statement</a></li>
                                <li><a href="#OPTION-BASE"><code>OPTION BASE</code> statement</a></li>
                                <li><a href="#OUT"><code>OUT</code> statement</a></li>
                                <li><a href="#PAINT"><code>PAINT</code> statement</a></li>
                                <li><a href="#PALETTE"><code>PALETTE</code> statement</a></li>
                                <li><a href="#PALETTE-USING"><code>PALETTE USING</code> statement</a></li>
                                <li><a href="#PCOPY"><code>PCOPY</code> statement</a></li>
                                <li><a href="#PEEK"><code>PEEK</code> function</a></li>
                                <li><a href="#PEN-statement"><code>PEN</code> statement</a></li>
                                <li><a href="#PEN"><code>PEN</code> function</a></li>
                                <li><a href="#PLAY-event"><code>PLAY</code> statement (event-trapping control)</a></li>
                                <li><a href="#PLAY"><code>PLAY</code> statement (music)</a></li>
                                <li><a href="#PLAY-function"><code>PLAY</code> function</a></li>
                                <li><a href="#PMAP"><code>PMAP</code> function</a></li>
                                <li><a href="#POINT-coord"><code>POINT</code> function (current coordinate)</a></li>
                                <li><a href="#POINT-attr"><code>POINT</code> function (pixel attribute)</a></li>
                                <li><a href="#POKE"><code>POKE</code> statement</a></li>
                                <li><a href="#POS"><code>POS</code> function</a></li>
                                <li><a href="#PSET"><code>PSET</code> and <code>PRESET</code> statements</a></li>
                                <li><a href="#PRINT"><code>PRINT</code> and <code>LPRINT</code> statements</a></li>
                                <li><a href="#PUT-files"><code>PUT</code> statement (files)</a></li>
                                <li><a href="#PUT-serial"><code>PUT</code> statement (communications)</a></li>
                                <li><a href="#PUT-graphics"><code>PUT</code> statement (graphics)</a></li>
                                <li><a href="#RANDOMIZE"><code>RANDOMIZE</code> statement</a></li>
                                <li><a href="#READ"><code>READ</code> statement</a></li>
                                <li><a href="#REM"><code>REM</code> statement</a></li>
                                <li><a href="#RENUM"><code>RENUM</code> statement</a></li>
                                <li><a href="#RESET"><code>RESET</code> statement</a></li>
                                <li><a href="#RESTORE"><code>RESTORE</code> statement</a></li>
                                <li><a href="#RESUME"><code>RESUME</code> statement</a></li>
                                <li><a href="#RETURN"><code>RETURN</code> statement</a></li>
                                <li><a href="#RIGHT%24"><code>RIGHT$</code> function</a></li>
                                <li><a href="#RMDIR"><code>RMDIR</code> statement</a></li>
                                <li><a href="#RND"><code>RND</code> function</a></li>
                                <li><a href="#RSET"><code>RSET</code> statement</a></li>
                                <li><a href="#RUN"><code>RUN</code> statement</a></li>
                                <li><a href="#SAVE"><code>SAVE</code> statement</a></li>
                                <li><a href="#SCREEN-function"><code>SCREEN</code> function</a></li>
                                <li><a href="#SCREEN-statement"><code>SCREEN</code> statement</a></li>
                                <li><a href="#SGN"><code>SGN</code> function</a></li>
                                <li><a href="#SHELL"><code>SHELL</code> statement</a></li>
                                <li><a href="#SIN"><code>SIN</code> function</a></li>
                                <li><a href="#SOUND"><code>SOUND</code> statement</a></li>
                                <li><a href="#SOUND-switch"><code>SOUND</code> statement (switch)</a></li>
                                <li><a href="#SPACE%24"><code>SPACE$</code> function</a></li>
                                <li><a href="#SQR"><code>SQR</code> function</a></li>
                                <li><a href="#STICK"><code>STICK</code> function</a></li>
                                <li><a href="#STOP"><code>STOP</code> statement</a></li>
                                <li><a href="#STR%24"><code>STR$</code> function</a></li>
                                <li><a href="#STRIG-switch"><code>STRIG</code> statement</a></li>
                                <li><a href="#STRIG-events"><code>STRIG</code> statement (events)</a></li>
                                <li><a href="#STRIG-function"><code>STRIG</code> function</a></li>
                                <li><a href="#STRING%24"><code>STRING$</code> function</a></li>
                                <li><a href="#SWAP"><code>SWAP</code> statement</a></li>
                                <li><a href="#SYSTEM"><code>SYSTEM</code> statement</a></li>
                                <li><a href="#TAN"><code>TAN</code> function</a></li>
                                <li><a href="#TERM"><code>TERM</code> statement</a></li>
                                <li><a href="#TIME%24-function"><code>TIME$</code> function</a></li>
                                <li><a href="#TIME%24-statement"><code>TIME$</code> statement</a></li>
                                <li><a href="#TIMER-event"><code>TIMER</code> statement</a></li>
                                <li><a href="#TIMER"><code>TIMER</code> function</a></li>
                                <li><a href="#TRON"><code>TRON</code> and <code>TROFF</code> statements</a></li>
                                <li><a href="#UNLOCK"><code>UNLOCK</code> statement</a></li>
                                <li><a href="#USR"><code>USR</code> function</a></li>
                                <li><a href="#VAL"><code>VAL</code> function</a></li>
                                <li><a href="#VARPTR"><code>VARPTR</code> function</a></li>
                                <li><a href="#VARPTR%24"><code>VARPTR$</code> function</a></li>
                                <li><a href="#VIEW"><code>VIEW</code> statement</a></li>
                                <li><a href="#VIEW-PRINT"><code>VIEW PRINT</code> statement</a></li>
                                <li><a href="#WAIT"><code>WAIT</code> statement</a></li>
                                <li><a href="#WEND"><code>WEND</code> statement</a></li>
                                <li><a href="#WHILE"><code>WHILE</code> statement</a></li>
                                <li><a href="#WIDTH"><code>WIDTH</code> statement (console)</a></li>
                                <li><a href="#WIDTH-files"><code>WIDTH</code> statement (devices and files)</a></li>
                                <li><a href="#WINDOW"><code>WINDOW</code> statement</a></li>
                                <li><a href="#WRITE"><code>WRITE</code> statement</a></li>
                            </ul>
                        </li>
                        <li><a href="#error-trapping">Error trapping</a></li>
                        <li><a href="#event-trapping">Event trapping</a></li>
                    </ul>
                </li>
                <li><a href="#technical">Technical reference</a>
                    <ul>
                        <li><a href="#internal">Representation of variables</a></li>
                        <li><a href="#keywords">Keyword tokens</a></li>
                        <li><a href="#errors">Error codes</a></li>
                        <li><a href="#videomodes">Video modes</a></li>
                        <li><a href="#ascii">ASCII</a></li>
                        <li><a href="#cp437">Codepage 437</a></li>
                        <li><a href="#scancodes">Keyboard scancodes</a></li>
                        <li><a href="#eascii">Extended ASCII codes</a></li>
                        <li><a href="#colours">Colours</a></li>
                    </ul>
                </li>
                <li><a href="#acks_acknowledgements">Acknowledgements</a>
                    <ul>
                        <li><a href="#acks_contributors">Contributors</a></li>
                        <li><a href="#acks_shoulders-of-giants">Shoulders of Giants</a></li>
                        <li><a href="#acks_fond-memories">Fond memories</a></li>
                        <li><a href="#acks_technical-documentation">Technical Documentation</a></li>
                        <li><a href="#acks_fonts">Fonts</a></li>
                        <li><a href="#acks_unicode-codepage-mappings">Unicode-codepage mappings</a></li>
                        <li><a href="#acks_development-tools">Development tools</a></li>
                        <li><a href="#acks_emulators">Emulators</a></li>
                    </ul>
                </li>
                <li><a href="#licence">Licences</a>
                    <ul>
                        <li><a href="#pc-basic-interpreter">PC-BASIC interpreter</a></li>
                        <li><a href="#pc-basic-documentation">PC-BASIC documentation</a></li>
                    </ul>
            </li></ul>
</nav>
<article>
<h2 id="pc-basic">Overview</h2>
<p><em>A free, cross-platform emulator for the GW-BASIC family of interpreters.</em></p>
<p>PC-BASIC is a free, cross-platform interpreter for GW-BASIC, Advanced BASIC (BASICA), PCjr Cartridge Basic and Tandy 1000 GW-BASIC.
It interprets these BASIC dialects with a high degree of accuracy, aiming for bug-for-bug compatibility.
PC-BASIC emulates the most common video and audio hardware on which these BASICs used to run.
PC-BASIC runs ASCII, bytecode and protected .BAS files.
It implements floating-point arithmetic in the Microsoft Binary Format (MBF) and can therefore
read and write binary data files created by GW-BASIC.  </p>
<p>PC-BASIC is free and open source software released under the GPL version 3.  </p>
<p>See also the <a href="http://robhagemans.github.io/pcbasic/">PC-BASIC home page</a>.</p>
<p><img alt="" src="https://robhagemans.github.io/pcbasic/screenshots/pcbasic.png"></p>
<hr>
<h2 id="quick-start-guide">Quick Start Guide</h2>
<p>This quick start guide covers installation and elementary use of PC-BASIC. For more information, please refer to the <a href="#">full PC-BASIC documentation</a> which covers usage, command-line options and a full <a href="#reference">GW-BASIC language reference</a>. This documentation is also included with the current PC-BASIC release.</p>
<p>If you find bugs, please report them on the <a href="https://sourceforge.net/p/pcbasic/discussion/bugs/">SourceForge discussion page</a> or <a href="https://github.com/robhagemans/pcbasic/issues">open an issue on GitHub</a>. It would be most helpful if you could include a short bit of BASIC code that triggers the bug.</p>
<h3 id="installation">Installation</h3>
<p>Packaged distributions can be downloaded from one of the following locations:  </p>
<ul>
<li><a href="https://github.com/robhagemans/pcbasic/releases">PC-BASIC releases on GitHub</a>  </li>
<li><a href="https://sourceforge.net/projects/pcbasic/files/">PC-BASIC releases on SourceForge</a>  </li>
</ul>
<p>On <strong>Windows</strong>:  </p>
<ul>
<li>run the installer  </li>
<li>to start, click PC-BASIC in your Start menu  </li>
</ul>
<p>On <strong>OS X</strong>:  </p>
<ul>
<li>mount the disk image  </li>
<li>to start, double click the PC-BASIC app  </li>
</ul>
<p>On <strong>Linux</strong> and <strong>other Unix</strong>:  </p>
<ul>
<li>untar the archive  </li>
<li>run <code>sudo ./install.sh</code>. You may be asked to install further dependencies through your OS's package management system.  </li>
<li>to start, click PC-BASIC in your Applications menu or run <code>pcbasic</code> on the command line.  </li>
</ul>
<p>If the options above are not applicable or you prefer to install from source, please
consult <a href="https://github.com/robhagemans/pcbasic/blob/master/INSTALL.md"><code>INSTALL.md</code></a> for detailed instructions.</p>
<h3 id="usage-essentials">Usage essentials</h3>
<p>Double-click on <code>pcbasic</code> or run <code>pcbasic</code> on the Windows, OSX or Linux command line to start in interactive mode with no program loaded.<br>
A few selected command-line options:<br>
<code>pcbasic PROGRAM.BAS</code> runs PROGRAM.BAS directly.<br>
<code>pcbasic -h</code> shows all available command line options.  </p>
<p>If you're running PC-BASIC from a GUI, you can set the required options in the configuration file instead.
The configuration file is stored in the following location:</p>
<table>
<thead>
<tr>
<th>OS</th>
<th>Configuration file</th>
</tr>
</thead>
<tbody>
<tr>
<td>Windows</td>
<td><code>%APPDATA%\pcbasic\PCBASIC.INI</code></td>
</tr>
<tr>
<td>OS X</td>
<td><code>~/Library/Application Support/pcbasic/PCBASIC.INI</code></td>
</tr>
<tr>
<td>Linux</td>
<td><code>~/.config/pcbasic/PCBASIC.INI</code></td>
</tr>
</tbody>
</table>
<p>For example, you could include the following line in <code>PCBASIC.INI</code> to emulate IBM PCjr Cartridge Basic instead of GW-BASIC 3.23:</p>
<pre><code>preset=pcjr
</code></pre>
<h3 id="basic-basic-commands">Basic BASIC commands</h3>
<p>PC-BASIC starts in interactive mode, where you can execute BASIC statements directly.
A few essential statements:<br>
<code>SYSTEM</code> exits PC-BASIC.<br>
<code>LOAD "PROGRAM"</code> loads <code>PROGRAM.BAS</code> (but does not start it).<br>
<code>RUN</code> starts the currently loaded program.  </p>
<p>Use one of the key combinations <code>Ctrl+Break</code>, <code>Ctrl+Scroll Lock</code>, <code>Ctrl+C</code> or <code>F12+B</code>
to terminate the running program and return to interactive mode.  </p>
<h3 id="get-basic-programs">Get BASIC programs</h3>
<p>The following pages have GW-BASIC and Tandy 1000 BASIC program downloads, lots of information and further links.  </p>
<ul>
<li><a href="http://www.oocities.org/KindlyRat/GWBASIC.html">KindlyRat</a>'s archived geocities page has a number of classic games and utilities.  </li>
<li><a href="http://archive.is/AUm6G">PeatSoft</a> provides GW-BASIC documentation, utilities and some more games.  </li>
<li><a href="http://www.gw-basic.com/">Neil C. Obremski's gw-basic.com</a> has fun new games made in GW-BASIC over the last few years!  </li>
<li><a href="http://peyre.x10.mx/GWBASIC/">Leon Peyre</a> has a nice collection of GW-BASIC programs, including the original IBM PC-DOS 1.1 samples and the (in)famous <code>DONKEY.BAS</code>.  </li>
<li><a href="http://www.brooksdeforest.com/tandy1000/">Brooks deForest</a> provides his amazing Tandy BASIC games, all released into the public domain.  </li>
<li><a href="http://www.oldskool.org/guides/tvdog/">TVDog's Archive</a> is a great source of Tandy 1000 information and BASIC programs.  </li>
<li><a href="http://www.scn.org/~bh162/basic_programs.html">Phillip Bigelow</a> provides scientific programs written in GW-BASIC, as many science and engineering programs once were.  </li>
<li><a href="http://www.garypeek.com/basic/gwprograms.htm">Gary Peek</a> provides miscellaneous GW-BASIC sources which he released into the public domain.  </li>
<li><a href="http://www.moorecad.com/classicbasic/index.html">S.A. Moore's Classic BASIC Games page</a> has some nice pictures of retro hardware and the BASIC Games from David Ahl's classic book.  </li>
<li><a href="http://www.geocities.ws/joseph_sixpack/btoc.html">Joseph Sixpack's Last Book of GW-BASIC</a> has lots of GW-BASIC office and utility programs, including the PC-CALC spreadsheet.  </li>
<li><a href="http://cd.textfiles.com">cd.textfiles.com</a> has tons of old shareware, among which some good GW-BASIC games - dig around here to find some treasures...  </li>
</ul></article>
<!--
    PC-BASIC documentation
    Copyright (c) 2014-2015 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->

<article>
    <h2 id="using">User's guide</h2>

    <section>
        <h3 id="workenv">The working environment</h3>
        <p>
            The first thing you'll see when starting PC-BASIC is the working environment.
            Like GW-BASIC, but unlike practically all modern compilers and interpreters,
            PC-BASIC's working environment serves both as a development environment and as a
            canvas on which to execute BASIC commands directly. With a few exceptions,
            practically all commands that can be run in the working environment can be used
            in a program, and vice versa.
        </p>
        <p>
            The default PC-BASIC screen has 25 rows and 80 columns. The 25th row is used
            by PC-BASIC to show keyboard shortcuts,
            which means you can't use it to type on. In some video modes, there are only 40
            or 20 columns.
        </p>
        <p>
            <em>Logical lines</em> exceed the width of the physical row: if you keep
            typing beyond the screen width, the text will
            wrap to the next line but PC-BASIC will still consider it part of the same line.
            A logical line can be at most 255 characters long; if you type more than 255
            characters, it will ignore the remainder. A line can also be wrapped by a
            line-feed, entered with <kbd>Ctrl</kbd>+<kbd>Enter</kbd>.
        </p>
        <p>
            If you press <kbd>Enter</kbd>, PC-BASIC will attempt to execute the
            logical line on which the cursor is placed as a command. When the command is executed correctly,
            PC-BASIC will display the prompt <samp>Ok</samp>. If there is an error, it will
            display an error message followed by <samp>Ok</samp>.
            If the line starts with a number, it will be stored as a program line. No prompt is displayed.
        </p>

        <section>
            <h4 id="special-keys">Special keys</h4>
            <p>The following keys have a special effect in the working environment:</p>
            <div class="scrollable">
                <table>
                    <tr>
                        <td><kbd>&#8593;<!--up--></kbd> or <kbd>Ctrl</kbd>+<kbd>6</kbd></td>
                        <td>Move the cursor up, except at the top row.</td>
                    </tr>
                    <tr>
                        <td><kbd>&#8595;<!--down--></kbd> or <kbd>Ctrl</kbd>+<kbd>-</kbd></td>
                        <td>Move the cursor down, except at row 24.</td>
                    </tr>
                    <tr>
                        <td><kbd>&#8592;<!--left--></kbd> or <kbd>Ctrl</kbd>+<kbd>]</kbd></td>
                        <td>Move the cursor left. The left edge of the screen wraps around, except at the top row.</td>
                    </tr>
                    <tr>
                        <td><kbd>&#8594;<!--right--></kbd> or <kbd>Ctrl</kbd>+<kbd>/</kbd></td>
                        <td>Move the cursor right. The right edge of the screen wraps around, except at row 24.</td>
                    </tr>
                    <tr>
                        <td><kbd>Ctrl</kbd>+<kbd>&#8592;<!--left--></kbd> or <kbd>Ctrl</kbd>+<kbd>B</kbd></td>
                        <td>
                            Move to the first letter of the previous word. Words consist of
                            letters <code>A&#8212;Z</code> and figures <code>0&#8212;9</code>.
                        </td>
                    </tr>
                    <tr>
                        <td><kbd>Ctrl</kbd>+<kbd>&#8594;<!--right--></kbd> or <kbd>Ctrl</kbd>+<kbd>F</kbd></td>
                        <td>Move to the first letter of the next word.</td>
                    </tr>
                    <tr>
                        <td><kbd>Tab</kbd> or <kbd>Ctrl</kbd>+<kbd>I</kbd></td>
                        <td>Move the cursor to the next tab stop. Tab stops are 8 columns wide.</td>
                    </tr>
                    <tr>
                        <td><kbd>Backspace</kbd> or <kbd>Ctrl</kbd>+<kbd>H</kbd></td>
                        <td>
                            Delete the character left of the cursor, shift all further characters on the logical line one
                            position to the left and change the attributes of those characters to the current attribute. At the
                            left edge of the screen, this does the same as <kbd>Del</kbd>.
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <kbd>Del</kbd> or <kbd>Ctrl</kbd>+<kbd>Backspace</kbd>
                        </td>
                        <td>
                            Delete the character at the cursor and shift all
                            further characters one position to the left,
                            changing attributes to current.
                        </td>
                    </tr>
                    <tr>
                        <td><kbd>Esc</kbd> or <kbd>Ctrl</kbd>+<kbd>[</kbd></td>
                        <td>Delete the current logical line.</td>
                    </tr>
                    <tr>
                        <td><kbd>Ctrl</kbd>+<kbd>End</kbd> or <kbd>Ctrl</kbd>+<kbd>E</kbd></td>
                        <td>
                            Delete all characters from the cursor to the end
                            of the logical line.
                        </td>
                    </tr>
                    <tr>
                        <td><kbd>Ctrl</kbd>+<kbd>Break</kbd> or <kbd>Ctrl</kbd>+<kbd>C</kbd> or <kbd>Ctrl</kbd>+<kbd>Scroll Lock</kbd></td>
                        <td>Jump to the first column of the next line, without executing or storing the line under the cursor.</td>
                    </tr>
                    <tr>
                        <td><kbd>Enter</kbd> or <kbd>Ctrl</kbd>+<kbd>M</kbd></td>
                        <td>
                            Execute or store the current logical line. The
                            complete line on the screen is considered part of
                            the command, even if you did not type it.
                            A line starting with a number is stored as a
                            program line.
                        </td>
                    </tr>
                    <tr>
                        <td><kbd>End</kbd> or <kbd>Ctrl</kbd>+<kbd>N</kbd></td>
                        <td>
                            Move the cursor to the first position after the
                            end of the logical line.
                        </td>
                    </tr>
                    <tr>
                        <td><kbd>Home</kbd> or <kbd>Ctrl</kbd>+<kbd>K</kbd></td>
                        <td>Move the cursor to the top left of the screen.</td>
                    </tr>
                    <tr>
                        <td><kbd>Ctrl</kbd>+<kbd>Home</kbd> or <kbd>Ctrl</kbd>+<kbd>L</kbd></td>
                        <td>
                            Clear the screen and move the cursor to the top
                            left of the screen.
                        </td>
                    </tr>
                    <tr>
                        <td><kbd>Ctrl</kbd>+<kbd>Enter</kbd> or <kbd>Ctrl</kbd>+<kbd>J</kbd></td>
                        <td>
                            Move to the first column of the next line,
                            connecting the two lines into one logical line.
                        </td>
                    </tr>
                    <tr>
                        <td><kbd>Ctrl</kbd>+<kbd>G</kbd></td>
                        <td>Beep the speaker.</td>
                    </tr>
                    <tr>
                        <td><kbd>Pause</kbd> or <kbd>Ctrl</kbd>+<kbd>Num Lock</kbd></td>
                        <td>Pause. Press another key to resume.</td>
                    </tr>
                    <tr>
                        <td><kbd>Ctrl</kbd>+<kbd>Prt Sc</kbd></td>
                        <td>Toggle echoing screen output to the printer (or other device attached to <code>LPT1:</code>).</td>
                    </tr>
                    <tr>
                        <td><kbd>Shift</kbd>+<kbd>Prt Sc</kbd></td>
                        <td>Print the screen.</td>
                    </tr>
                    <tr>
                        <td><kbd>Ins</kbd> or <kbd>Ctrl</kbd>+<kbd>R</kbd></td>
                        <td>
                            Toggle <em>insert mode</em>. In insert mode, characters
                            are inserted rather than overwritten at the
                            current location. If insertion causes the line to
                            extend the physical screen width, the logical
                            line extends onto the next line. Arrow keys exit
                            insert mode.
                        </td>
                    </tr>
                </table>
            </div>

            <p>
                When a program is started, the commands in the program are followed until the
                program quits and returns to interactive mode or until user input is required.
                When a program is running, a few keys have immediate effect:
            </p>
            <div class="scrollable">
                <table>
                    <tr>
                        <td>
                            <kbd>Pause</kbd> or <kbd>Ctrl</kbd>+<kbd>Num Lock</kbd>
                        </td>
                        <td>
                            Pause execution. Press another key to resume.
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <kbd>Ctrl</kbd>+<kbd>Break</kbd>
                            or <kbd>Ctrl</kbd>+<kbd>Scroll Lock</kbd>
                        </td>
                        <td>
                            Stop execution and return to interactive mode. A <samp>Break</samp> message is printed.
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <kbd>Ctrl</kbd>+<kbd>C</kbd>
                        </td>
                        <td>
                            If <code><a href="#--ctrl-c-break">ctrl-c-break</a>=True</code>: stop execution and return to interactive mode.
                            A <samp>Break</samp> message is printed.
                        </td>
                    </tr>
                </table>
            </div>

            <p>
                If user input is required by the statements <code>INPUT</code>, <code>LINE INPUT</code>, or <code>RANDOMIZE</code>,
                most keys have the same effect as in interactive mode. The following keys have a different effect:
            </p>
            <div class="scrollable">
                <table>
                    <tr>
                        <td>
                            <kbd>Ctrl</kbd>+<kbd>Break</kbd> or <kbd>Ctrl</kbd>+<kbd>C</kbd>
                            or <kbd>Ctrl</kbd>+<kbd>Scroll Lock</kbd>
                        </td>
                        <td>
                            Stop execution and return to interactive mode.
                            A <samp>Break</samp> message is printed.
                        </td>
                    </tr>
                    <tr>
                        <td><kbd>Enter</kbd></td>
                        <td>
                            Finish input and return to the previous mode.
                        </td>
                    </tr>
                </table>
            </div>
        </section>
        <hr>

        <section>
            <h4 id="shortcuts">Keyboard shortcuts</h4>
            <p>
                The function keys and the alt key can be used as keyboard shortcuts for some
                keywords.
                The default values for the function keys are:
            </p>
            <div class="scrollable">
                <table>
                    <tr>
                        <td><kbd>F1</kbd></td>
                        <td><code><a href="#LIST">LIST</a></code></td>
                    </tr>
                    <tr>
                        <td><kbd>F2</kbd></td>
                        <td><code><a href="#RUN">RUN</a></code><kbd>Enter</kbd></td>
                    </tr>
                    <tr>
                        <td><kbd>F3</kbd></td>
                        <td><code><a href="#LOAD">LOAD</a>"</code></td>
                    </tr>
                    <tr>
                        <td><kbd>F4</kbd></td>
                        <td><code><a href="#SAVE">SAVE</a>"</code></td>
                    </tr>
                    <tr>
                        <td><kbd>F5</kbd></td>
                        <td><code><a href="#CONT">CONT</a></code><kbd>Enter</kbd></td>
                    </tr>
                    <tr>
                        <td><kbd>F6</kbd></td>
                        <td><code>,"LPT1:"</code><kbd>Enter</kbd></td>
                    </tr>
                    <tr>
                        <td><kbd>F7</kbd></td>
                        <td><code><a href="#TRON">TRON</a></code><kbd>Enter</kbd></td>
                    </tr>
                    <tr>
                        <td><kbd>F8</kbd></td>
                        <td><code><a href="#TRON">TROFF</a></code><kbd>Enter</kbd></td>
                    </tr>
                    <tr>
                        <td><kbd>F9</kbd></td>
                        <td><code><a href="#KEY-list">KEY</a></code><kbd>Space</kbd></td>
                    </tr>
                    <tr>
                        <td><kbd>F10</kbd></td>
                        <td><code><a href="SCREEN-statement">SCREEN</a> 0,0,0</code><kbd>Enter</kbd></td>
                    </tr>
                </table>
            </div>
            <p>
                The function key shortcuts can be redefined with the <code>KEY</code> statement.
                The shortcuts are displayed at the bottom of the screen.
            </p>
            <p>
                The following keywords can be entered
                with <kbd>Alt</kbd>+first letter. The <kbd>Alt</kbd> shortcuts cannot be redefined.
            </p>
            <ul class="compact">
                <li><code><a href="#AUTO">AUTO</a></code></li>
                <li><code><a href="#BSAVE">BSAVE</a></code></li>
                <li><code><a href="#COLOR">COLOR</a></code></li>
                <li><code><a href="#DELETE">DELETE</a></code></li>

                <li><code><a href="#ELSE">ELSE</a></code></li>
                <li><code><a href="#FOR">FOR</a></code></li>
                <li><code><a href="#GOTO">GOTO</a></code></li>
                <li><code><a href="#HEX%24">HEX$</a></code></li>

                <li><code><a href="#INPUT">INPUT</a></code></li>
                <li><code><a href="#KEY-list">KEY</a></code></li>
                <li><code><a href="#LOCATE">LOCATE</a></code></li>
                <li><code><a href="#MOTOR">MOTOR</a></code></li>

                <li><code><a href="#NEXT">NEXT</a></code></li>
                <li><code><a href="#OPEN">OPEN</a></code></li>
                <li><code><a href="#PRINT">PRINT</a></code></li>
                <li><code><a href="#RUN">RUN</a></code></li>

                <li><code><a href="#SCREEN">SCREEN</a></code></li>
                <li><code><a href="#THEN">THEN</a></code></li>
                <li><code><a href="#PRINT">USING</a></code></li>
                <li><code><a href="#VAL">VAL</a></code></li>

                <li><code><a href="#WIDTH">WIDTH</a></code></li>
                <li><code><a href="#XOR">XOR</a></code></li>
            </ul>
        </section>
        <hr>

        <section>
            <h4 id="alternative-keys">Alternative keys</h4>
            <p>
                In PC-BASIC, the <kbd>F12</kbd> key can be used to enter special keys that are not
                present on some keyboards.
            </p>
            <table>
                <tr>
                    <td><kbd>F12</kbd>+<kbd>B</kbd></td>
                    <td><kbd>Ctrl</kbd>+<kbd>Break</kbd></td>
                </tr>
                <tr>
                    <td><kbd>F12</kbd>+<kbd>P</kbd></td>
                    <td><kbd>Pause</kbd></td>
                </tr>
                <tr>
                    <td><kbd>F12</kbd>+<kbd>C</kbd></td>
                    <td><kbd>Caps Lock</kbd></td>
                </tr>
                <tr>
                    <td><kbd>F12</kbd>+<kbd>N</kbd></td>
                    <td><kbd>Num Lock</kbd></td>
                </tr>
                <tr>
                    <td><kbd>F12</kbd>+<kbd>S</kbd></td>
                    <td><kbd>Scroll Lock</kbd></td>
                </tr>
            </table>
            <p>
                The <kbd>F12</kbd> key can also be used in combination with the regular number
                keys and arrow keys to enter numbers from the numeric keypad.
                The <kbd>F12</kbd> combinations are not present in GW-BASIC.
            </p>
            <p>
                Furthermore, as in GW-BASIC, the <kbd>Alt</kbd> key can be used to enter characters by their ASCII code.
                This is done by pressing the <kbd>Alt</kbd> key and typing the decimal value of the
                ASCII code on the numeric keypad, then releasing the <kbd>Alt</kbd> key.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="clipboard-operations">Clipboard operations</h4>
            <p>
                Unlike in GW-BASIC, you can copy and paste text to the clipboard.
                This can be done with the mouse or with the <kbd>F11</kbd> key.
            </p>
            <p>
                Operating the clipboard with the mouse works in the style of X11:
                Left button is select and copy; middle button
                is paste.
            </p>
            <p>
                The following keyboard combinations also operate the clipboard:
            </p>
            <div class="scrollable">
                <table>
                    <tr>
                        <td>
                            <kbd>F11</kbd>+<kbd>&#8593;<!--up--></kbd><kbd>&#8595;<!--down--></kbd><kbd>&#8592;<!--left--></kbd><kbd>&#8594;<!--right--></kbd>
                        </td>
                        <td>Select a screen region.</td>
                    </tr>
                    <tr>
                        <td><kbd>F11</kbd>+<kbd>A</kbd></td>
                        <td>Select all.</td>
                    </tr>
                    <tr>
                        <td><kbd>F11</kbd>+<kbd>C</kbd></td>
                        <td>Copy to clipboard.</td>
                    </tr>
                    <tr>
                        <td><kbd>F11</kbd>+<kbd>V</kbd></td>
                        <td>Paste from clipboard.</td>
                    </tr>
                </table>
            </div>
        </section>
        <hr>

        <section>
            <h4 id="emulator-keys">Emulator control keys</h4>
            <p>
                In PC-BASIC, <kbd>F11</kbd>+<kbd>F</kbd> toggles fullscreen mode.
            </p>
        </section>
        <hr>
    </section>

    <section>
        <h3 id="programs">BASIC programs</h3>
        <p>
            PC-BASIC can hold one BASIC program at a time in memory. To enter a program
            line, start with a <em>line number</em> and enter BASIC commands after that.
            The maximum length of a program line is 255 characters, including the line
            number and any spaces. The program line will not be immediately executed, but
            stored in the program. Program lines are sorted by line number, so that line
            <code>10</code> is executed before line <code>20</code>. All program
            lines must have a line number. Line numbers range from <code>0</code> to <code>65535</code> inclusive.
            It is not possible to enter a line number higher than <code>65529</code>, but these can
            exist in loaded programs. In GW-BASIC and if <code>strict-hidden-lines=True</code>,
            lines between <code>65530</code> and <code>65535</code> are not visible in
            the program's <code><a href="#LIST">LIST</a></code>.
            Within one program line, statements are separated by colons <code>:</code>.
        </p>
         <p>
             To run the program, type the command <code>RUN</code>. PC-BASIC will now
            execute all program lines in order inside the working environment. You cannot
            move the cursor around or enter commands while the program is running. If and
            when the program finishes, it will return control of the working environment to
            you. You can interrupt a program at any time by using one of the key
            combinations <kbd>Ctrl</kbd>+<kbd>Break</kbd> or <kbd>Ctrl</kbd>+<kbd>Scroll
            Lock</kbd>. The program will stop immediately, print a <samp>Break</samp>
            message and return control to you.
        </p>
        <p>
            In GW-BASIC, you can <em>not</em> use  <kbd>Ctrl</kbd>+<kbd>C</kbd> to interrupt a running program.
            However, many modern keyboards do not have a <kbd>Break</kbd> or
            <kbd>Scroll Lock</kbd> key, which would make it impossible to interrupt
            a program that does not exit. Therefore, by default, PC-BASIC treats <kbd>Ctrl</kbd>+<kbd>C</kbd>
            as if it were <kbd>Ctrl</kbd>+<kbd>Break</kbd>. Set <code><a href="#--ctrl-c-break">ctrl-c-break</a>=False</code>
            if you prefer the GW-BASIC style behaviour. When using the text-based or command-line interface,
            this option is ignored.
        </p>
        <p>
            A program can be stored on a drive by using the <code><a href="#SAVE">SAVE</a></code> command, in one of three ways:
        </p>
        <ol>
            <li>ASCII text, readable by a text editor: <code>SAVE "MYPROG",A</code></li>
            <li>Bytecode, taking up less storage space: <code>SAVE "MYPROG"</code></li>
            <li>Protected, which is an encrypted format:  <code>SAVE "MYPROG",P</code></li>
        </ol>
        <p>
            In all three cases, the program will be written to the current working
            directory with the name <code>MYPROG.BAS</code>.
        </p>
        <p>
            PC-BASIC can read and write Protected files created by GW-BASIC. Unlike
            GW-BASIC, however, it does not disable accessing the unencrypted contents of the
            file. The encryption used by GW-BASIC has been broken many decades ago, so
            Protected mode offered little protection anyway; disallowing access is a small
            security hazard as it would allow someone to send you a program that you cannot
            inspect before running it. However, it is possible to disable access of
            protected files by enabling the option <code><a href="#--strict-protect">strict-protect</a></code>. </p> <p>You
            can read a program file into memory with <code><a href="#LOAD">LOAD</a> "MYPROG"</code>. This will
            erase the program currently in memory and replace it with the one read from the
            current working directory. To access files in a different directory, specify a path from the current
            directory. The path specification follows DOS conventions. The only valid path
            separator is the backslash <code>\</code>. For example, <code>LOAD "PROGRAMS\MYPROG"</code>.
        </p>
        <p>
            You can load or run a program immediately on starting PC-BASIC by using the
            <code><a href="#--load">load</a></code> or <code><a href="#--run">run</a></code> options.
            For example,
        </p>
        <code class="block">
            <b>pcbasic --run=MYPROG.BAS</b>
        </code>
        <p>
            The arguments to these options can be provided
            as PC-BASIC paths or as paths in the standard form for your operating
            system.
        </p>
        <p>
            PC-BASIC can be used to convert between the three program formats: either by loading the program and saving
            in your desired format, or from the command line using the <code><a href="#--convert">convert</a></code> option. To convert a
            bytecode or protected file to ASCII you could use, for example:
        </p>
        <code class="block">
            <b>pcbasic --convert=A PROGRAMP.BAS PROGRAMA.BAS</b>
        </code>

        <section>
            <h4 id="eightpointthree">File names on disk</h4>
            <p>
                PC-BASIC follows DOS file system conventions, where file and directory names consist of a
                8-character name and 3-character extension. Names are case insensitive.
                Permissible characters for both filename and extension are the
                printable ASCII characters in the range
                <code>&amp;H20</code>&#8211;<code>&amp;H7E</code> excluding the characters
                <code>" * + . , / : ;  ? \ [ ] |</code>.
                The special device filenames <code>AUX</code>, <code>CON</code>, <code>PRN</code> and
                <code>NUL</code> are not legal names for files on disk.
            </p>
            <p>
                Note that DOS conventions are subtly different from Windows short filename
                conventions and not-so-subtly different from Unix conventions. This may lead
                to surprising effects in the presence of several files that match
                the same DOS name. To avoid such surprises, run PC-BASIC in a working
                directory of its own and use all-caps 8.3 format for all files.
            </p>
            <h5>Data files</h5>
            <p>
                When opening a data file, PC-BASIC will first look for a file with the name
                exactly as provided. This can be a long name and will be case sensitive if
                your file system is. If such a file is not found, it will truncate the name
                provided to 8.3 format and convert to all uppercase. If that exact name is
                not found, it will look for 8.3 names in mixed case which match the name
                provided in a case-insensitive way. Such files are searched in lexicographic
                order. Files names longer than 8.3 will not be matched, unless their name is entered exactly.
                On Windows, the name matched can be a short filename as well as a
                long filename provided it is of 8.3 length &#8212; it may, for example, contain
                spaces and thus not be a valid Windows short file name.
            </p>
            <h5>Program files</h5>
            <p>
                When loading or saving a program or memory-dump file, no attempt is made to find an exact
                match. Instead, the search will first match the all-caps 8.3 version of the
                name and continue in lexicographic order as above. If no extension is
                specified, the extension <code>.BAS</code> will be implicitly added. To load a program
                with no extension, end the filename in a dot. On file systems without
                short filenames, it is not possible to load a program if its filename is
                longer than 8.3, contains non-permissible characters or ends in a dot.
            </p>
            <h5>Directory paths</h5>
            <p>
                In paths, the directory names must be separated with
                backslashes <code>\</code> &#8212; even if the OS normally separates paths with
                forward slashes. The matching rules for directory names
                are the same as for data files.
            </p>
            <p>
                A path starting with a backslash is interpreted as an absolute path,
                starting at the root of the specified disk device. Otherwise, the
                path is interpreted as relative to the current directory on the
                specified device. The directory name
                <code>..</code> refers to the parent directory of a preceding path, or the
                parent directory of the current directory if no path is given.
                The directory name <code>.</code> refers to the same directory as
                given by the preceding path, or the current directory if no preceding path is given.
            </p>
            <h5>Differences with GW-BASIC under MS-DOS</h5>
            <ul>
                <li>
                    In some setups, MS-DOS
                    also allows some characters in the range
                    <code>&amp;H7F</code>&#8211;<code>&amp;HFF</code>. However, their
                    permissibility and interpretation depends on the console code page,
                    which may be different from the display code page that affects GW-BASIC.
                    Depending on its console code page, MS-DOS will replace accented
                    letters by their unaccented uppercase variant.
                </li>
                <li>
                    Some DOS implementations will remove spaces from filenames.
                    Notably, this is the case on DOSBox.
                </li>
                <li>
                    PC-BASIC allows spaces in file names but no characters in the range
                    <code>&amp;H7F</code>&#8211;<code>&amp;HFF</code>.
                </li>
            </ul>
        </section>
        <hr>

        <section>
            <h4 id="mounting">Accessing your drives</h4>
            <p>
                By default, drive letter <code>Z:</code> is mapped to the current working directory and
                is the current drive. In particular, it is not mapped to the Windows <code>Z:</code>
                drive, if that exists. You can map drives and other file system locations as PC-BASIC drive letters by
                using the <code><a href="#--mount">mount</a></code> option. For example,
                <code class="block">
                    <b>pcbasic --mount=A:/home/me/BasicFloppy,C:/home/me/Stuff</b>
                </code>
                or, on Windows,
                <code class="block">
                    <b>pcbasic --mount=A:C:\Users\Me\BasicFloppy,C:C:\Users\Me\Stuff</b>
                </code>
                will map those locations to the PC-BASIC <code>A:</code> and <code>C:</code> drives.
            </p>
             <p>
                 If you want PC-BASIC's drive letters to be the same as those in Windows,
                enable the option <code><a href="#--map-drives">map-drives</a></code>. Use this with caution, since it
                means that your programs can now read and write on all drives that Windows
                allows you access to.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="program-files">Compatible BASIC files</h4>
            <p>
                Many BASIC dialects use the same extension <code>.BAS</code>, but their files are not compatible.
                PC-BASIC runs GW-BASIC program files only. Some tips to recognise GW-BASIC programs:
            </p>
            <ul>
                <li>GW-BASIC files stored as ASCII are plain text files with line numbers.</li>
                <li>Bytecode files are binary files that start with magic byte <code>FF</code>.</li>
                <li>Protected files are binary files that start with magic byte <code>FE</code>.</li>
            </ul>
            <p>
                In particular, QBASIC files (which have no line numbers) and QuickBASIC files
                (magic byte <code>FC</code>) will not run.</p>
                <p>PC-BASIC will accept both DOS and Unix newline conventions for programs
                stored as ASCII text. This behaviour is different from GW-BASIC, which only
                accepts text files in DOS format: <code>CR/LF</code> line endings,
                <code>^Z</code> (character 26) at end-of-file. In some exceptional cases,
                correct GW-BASIC ASCII files may not be loaded correctly: for example, if they
                contain LF characters followed by a number. If you encounter such a case, use
                the <code><a href="#--strict-newline">strict-newline</a></code> option to enable GW-BASIC behaviour. If
                <code>strict-newline</code> is enabled, ASCII files in standard Unix format
                (<code>LF</code> line endings, no end-of-file character) will fail to load. On
                Linux or Mac, use a utility such as
                <a href="http://waterlan.home.xs4all.nl/dos2unix.html"><code>unix2dos</code></a>
                to convert programs saved as text files before loading them. When saving as ASCII,
                PC-BASIC always uses the DOS conventions.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="packages">Packages</h4>
            <p>
                PC-BASIC can run packaged programs. A package is simply a directory or zip archive.
                The directory or zipfile contents will be loaded as the current working
                directory. If a configuration file named <code>PCBASIC.INI</code> is present
                inside this directory, its settings are loaded; usually, one of those settings will be a
                <code><a href="#--run">run</a></code> argument linking to a BASIC program enclosed in the archive or directory.
                PC-BASIC will recognise zipfiles regardless of their extension.
                A suggested extension for PC-BASIC packages is <code>.BAZ</code>.
                Packages are a convenient choice if a program needs to change many PC-BASIC options
                to function as desired, or if it needs a particular working directory setup.
            </p>
            <p>
                Zipfile packages are unpacked to a temporary directory each time they are loaded.
                The temporary directory is removed when PC-BASIC closes. With zipfile packages, it is therefore
                not possible to save files and re-open them on the next run of the package.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="security">Security</h4>
            <p>PC-BASIC makes some default choices with basic security in mind, but does not
                sandbox its programs in any meaningful way. BASIC programs have more or less
                full access to your computer. You should treat them with the same caution as
                you would shell scripts or binaries. Therefore, do not run a program from the
                internet that you have not inspected first using <code><a href="#LIST">LIST</a></code> or
                <code><a href="#--convert">--convert</a>=A</code> on the command line. You wouldn't just download
                an executable from the internet and run it either, right?</p>
        </section>
        <hr>
    </section>

    <section>
        <h3 id="devices">Devices</h3>
        <p>
            PC-BASIC recognises the following DOS-style devices, which can be
            <a href="#OPEN">opened</a>, <a href="#INPUT-file">input from</a>
            and <a href="#PRINT">output to</a>. Some devices allow specification of further parameters, such
            as handshake specifications for serial devices, a filename for cassette devices and a path for disk devices.
            When operating on disk devices, specifying a path is mandatory.
        </p>
        <p>
            The <i>filename aliases</i> listed here are only available if the
            <a href="#--current-device">current device</a> is a disk device.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Device</th>
                    <th>Filename alias</th>
                    <th>Allowed modes</th>
                    <th>Description</th>
                </tr>
                <tr>
                    <td><code>SCRN:</code></td>
                    <td><code>CON</code></td>
                    <td><code>OUTPUT</code></td>
                    <td>
                        The screen. Output to <code>SCRN:</code> has largely the same
                        effect as straight output using <code><a href="#PRINT">PRINT</a></code>.
                        A difference is the <code><a href="#WIDTH">WIDTH</a></code> setting which is
                        independent of the real screen width.
                    </td>
                </tr><tr>
                    <td><code>KYBD:</code></td>
                    <td><code>CON</code></td>
                    <td><code>INPUT</code></td>
                    <td>
                        The keyboard. Input read from <code>KYBD:</code> is not echoed
                        to the screen. Special keys like arrow keys are
                        registered differently than when using <code><a href="#INPUT">INPUT</a></code>
                        or <code><a href="#INPUT%24">INPUT$</a></code> straight.
                    </td>
                </tr><tr>
                    <td><code>LPT1:</code> <code>LPT2:</code> <code>LPT3:</code></td>
                    <td><code>PRN</code> for <code>LPT1:</code></td>
                    <td><code>OUTPUT</code> <code>RANDOM</code></td>
                    <td>
                        Parallel ports 1&#8212;3.
                        <code>LPT</code> devices can be
                        attached to the physical parallel port, to a printer or to a text file
                        with the
                        <code><a href="#--lpt1">--lpt<var>n</var></a></code> options.
                        Opening a printer for <code>RANDOM</code> has the same effect as opening it
                        for <code>OUTPUT</code>; attempting random-file operations will raise
                        <samp>Bad file mode</samp>.
                    </td>
                </tr><tr>
                    <td><code>COM1:</code> <code>COM2:</code></td>
                    <td><code>AUX</code> for <code>COM1:</code></td>
                    <td><code>INPUT</code> <code>OUTPUT</code> <code>APPEND</code> <code>RANDOM</code></td>
                    <td>
                        Serial ports 1&#8212;2.
                        <code>COM</code> devices can be attached to a
                        physical serial port or to a network socket with the
                        <code><a href="#--com1">--com<var>n</var></a></code> options.
                    </td>
                </tr>
                <tr>
                    <td><code>CAS1:</code></td>
                    <td></td>
                    <td><code>INPUT</code> <code>OUTPUT</code></td>
                    <td>
                        Cassette tape driver. <code>CAS</code> devices can be
                        attached to a WAV (RIFF Wave) or a CAS (bitmap tape image) file with the <code><a href="#--cas1">--cas1</a></code> option.
                    </td>
                </tr>
                <tr>
                    <td><code>A:</code> &#8212; <code>Z:</code> and <code>@:</code></td>
                    <td></td>
                    <td><code>INPUT</code> <code>OUTPUT</code> <code>APPEND</code> <code>RANDOM</code></td>
                <td>
                    Disk devices. These devices can be mounted to a directory on
                    the host file system with the <code><a href="#--mount">--mount</a></code> option.
                     They do not automatically match drive letters on Windows,
                    unless the <code><a href="#--map-drives">--map-drives</a></code> option
                     is set.
                </td>
                </tr>
                <tr>
                    <td></td>
                    <td><code>NUL</code></td>
                    <td><code>INPUT</code> <code>OUTPUT</code> <code>APPEND</code> <code>RANDOM</code></td>
                <td>
                    Null device. This device produces no bytes when opened for <code>INPUT</code>
                    and absorbs all bytes when opened for <code>OUTPUT</code>.
                </td>
                </tr>
            </table>
        </div>

        <section>
        <h4 id="printing">Printing</h4>
            <p>
                You can print from PC-BASIC programs
                by accessing the <code>LPT1:</code> device. PC-BASIC will send the output to
                your operating system's default printer, unless you change the <code>lpt1=</code>
                option. To print through a printer named <code>MyPrinter</code>, set
                <code><b><a href="#--lpt1">lpt1</a>=PRINTER:MyPrinter</b></code>. You can also attach printers to the
                <code>LPT2:</code> and <code>LPT3:</code> devices.
            </p>

            <p>
                The output will be sent to the printer when you close PC-BASIC. If you prefer,
                you can instead send every page separately to the printer by setting
                <code>print-trigger=page</code>. You can even send every line separately, but
                this only makes sense on a tractor-fed printer (as was common in GW-BASIC's
                heyday).
            </p>

            <p>
                It's easy to print to a file instead of a printer:
                set <code><b><a href="#--lpt1">lpt1</a>=FILE:output.txt</b></code>
                to send all <code>LPT1:</code> printer output to the text file <code>output.txt</code>.
            </p>
            <p>
                The printing statements <code><a href="#LPRINT">LPRINT</a></code> and <code><a href="#LLIST">LLIST</a></code> always send
                their output to PC-BASIC's <code>LPT1:</code> device.
            </p>

            <p>
                The presentation of printed documents is left to your operating system: it
                will be the default presentation of text files. If you wist to change the way
                documents are printed, please refer to your OS's settings. On Windows, for example, text files
                are printed by <code>notepad.exe</code> and changing the default settings in that
                application will change the way PC-BASIC documents are printed. You will need to set a
                printer font that includes the characters you need to print. On Unix systems,
                PC-BASIC will use the <code>paps</code> utility if it is available; this will
                automatically select fonts that support the characters you need.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="ports">Serial and parallel ports</h4>
            <p>
                PC-BASIC provides the serial devices <code>COM1:</code> and <code>COM2:</code>.
                To make use of these, you need to attach them to a communications port on your
                computer with the <code><a href="#--com1">com1</a>=</code> or <code><a href="#--com2">com2</a>=</code> option. To attach to
                the first physical serial port, set <code><b><a href="#--com1">com1</a>=PORT:0</b></code> (or, alternatively,
                <code><b><a href="#--com1">com1</a>=PORT:COM1</b></code> on Windows or
                <code><b><a href="#--com1">com1</a>=PORT:/dev/ttyS0</b></code> on
                Linux). If you do not have a serial port, you can emulate one by sending the
                communications over a network socket: set <code><b><a href="#--com1">com1</a>=SOCKET:localhost:7000</b></code>
                and all <code>COM1:</code> traffic will be sent through socket <code>7000</code>.
            </p>

            <p>
                To access a parallel port, attach it to one of <code>LPT1:</code>, <code>LPT2:</code> or <code>LPT3:</code>.
                For example, set <code><b><a href="#--lpt2">lpt2</a>=PARPORT:0</b></code> to attach your computer's first
                parallel port to <code>LPT2:</code>.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="cassette">Cassette interface and BASICODE</h4>
            <p>
                The <code>CAS1</code> device interfaces with the cassette tape emulator.
                Tapes were never very popular on the IBM PC, and indeed only available with the
                original PC and the PCjr. There are not many IBM PC cassettes in the wild.
                However, should you come across one, all you have to do to read it with PC-BASIC
                is record it into a <code>.WAV</code> (RIFF WAVE) file and attach it to the <code>CAS1:</code>
                device with the <code><a href="#--cas1">--cas1</a>=WAV:<var>filename</var></code> option.
                You can also generate your own tape images and store your programs on it. <code>WAV</code>
                files generated by PC-BASIC are large but very easily compressed in a <code>ZIP</code>
                archive; this works better and leads to smaller files than transcoding to a lossy
                audio format like <code>MP3</code>.
            </p>
            <p>
                As an alternative to <code>.WAV</code>, you can store tapes in <code>CAS</code>
                format. This is simply a bit-dump of the tape and is interchangeable
                with tape images for the <a href="http://www.hampa.ch/pce/">PCE</a> IBM PC emulator.
            </p>
            <p>
                BASICODE was a considerably more common audio encoding format, which enjoyed
                huge popularity in particular in the Netherlands, the UK and East Germany.
                BASICODE was distributed through tapes or as audio broadcast over radio.
                Reading it into a PC required special hardware, usually hooking up a tape
                recorder to a serial or parallel port.
                In PC-BASIC, BASICODE tapes are read through the <code>CAS1</code> device instead,
                by attaching a <code>.WAV</code> file with the <code><a href="#--cas1">--cas1</a>=BC:<var>filename</var></code>
                option. PC-BASIC will load the BASICODE, inserting the necessary spaces
                between keywords where the BASICODE standard leaves these out.
                Note that you will need a Bascoder program to run the BASICODE, and this is not
                currently distributed with PC-BASIC.
            </p>
            <p>
                If you have a Bascoder named <code>BASCODER.BAS</code>, the way to run
                a BASICODE program named <code>PROGRAM</code> from tape is:
            </p>
            <code class="block">
                LOAD "BASCODER"<br>
                CHAIN MERGE "CAS1:PROGRAM"
            </code>
        </section>
        <hr>
    </section>

    <section>
        <h3 id="interface">Changing the interface</h3>
        <section>
            <h4 id="presets">Emulation targets</h4>
            <p>
                By default, PC-BASIC emulates GW-BASIC on a system with VGA video capabilities.
                However, it can emulate several other setups, which differ from each other in
                terms of video and audio capacity, fonts, memory size, as well as available BASIC syntax.
                The easiest way to set the emulation target is by using a <code><a href="#--preset">preset</a></code> option.
                For example, run <code><b>pcbasic --preset=pcjr</b></code>.
                Other available emulation target presets are:
            </p>
            <div class="scrollable">
                <table>
                    <tr>
                        <th>Preset</th><th>Emulation target</th>
                    </tr>
                    <tr>
                        <td><code>pcjr</code></td>
                        <td>IBM PCjr with Cartridge BASIC, including PCjr video and 3-voice sound capabilities and extended BASIC syntax.</td>
                    </tr>
                    <tr>
                        <td><code>tandy</code></td>
                        <td>Tandy 1000 with GW-BASIC, including Tandy video and 3-voice sound capabilities and extended BASIC syntax.</td>
                    </tr>
                    <tr>
                        <td><code>olivetti</code></td>
                        <td>Olivetti M24 or AT&amp;T PC 6300.</td>
                    </tr>
                    <tr>
                        <td><code>cga</code></td>
                        <td>IBM or compatible with Color/Graphics Adapter and a composite monitor. This enables composite colorburst emulation.</td>
                    </tr>
                    <tr>
                        <td><code>ega</code></td>
                        <td>IBM or compatible with Extended Graphics Adapter.</td>
                    </tr>
                    <tr>
                        <td><code>vga</code></td>
                        <td>IBM or compatible with Video Graphics Array.</td>
                    </tr>
                    <tr>
                        <td><code>mda</code></td>
                        <td>
                            IBM or compatible with Monochrome Display Adapter and
                            green-tinted monochrome monitor.
                        </td>
                    </tr>
                    <tr>
                        <td><code>hercules</code></td>
                        <td>
                            IBM compatible with Hercules Graphics Adapter and green-tinted
                            monochrome monitor.
                        </td>
                    </tr>
                    <tr>
                        <td><code>strict</code></td>
                        <td>Choose strict compatibility with GW-BASIC over convenience,
                        security, rhyme or reason.</td>
                    </tr>
                </table>
            </div>
            <p>
                <em>Presets</em> are groups of options that are defined in the default configuration
                file. You can create your own presets by creating a header in your private configuration
                file with the name of the new preset, followed by the options you want to apply. For example,
                if you define:
                <code class="block">
                    [my_preset]<br>
                    video=vga<br>
                    syntax=pcjr<br>
                </code>
                you can now run <code><b>pcbasic --preset=my_preset</b></code> to start an emulation of
                a hypothetical machine with a VGA video card running PCjr Cartridge BASIC.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="codepages">Codepages</h4>
            <p>
                PC-BASIC supports a large number of legacy codepages that were common at the
                time GW-BASIC was popular, including double-byte character set codepages used
                for Chinese, Japanese and Korean. You can select your codepage by using the
                <code><a href="#--codepage">codepage</a>=</code> option. For example, <code>codepage=936</code> selects
                the GBK codepage commonly used on the Chinese mainland. PC-BASIC will load and
                save all program files as if encoded in the codepage you select.
            </p>
            <p>
                It is also possible to load and save programs in the nowadays common UTF-8
                standard format, by enabling the <code><a href="#--utf8">utf8</a></code> option. When
                <code>utf8</code> is enabled, "ASCII" program source will be saved and loaded in
                standard UTF-8 encoding. Please note that you will still need to select a
                codepage that provides all the Unicode characters that your program needs.
            </p>
            <p>
                Note that PC-BASIC does not implement the following features relevant to some of these codepages:
            </p>
            <dl>
                <dt id="bidi">
                    Bidirectional text
                </dt>
                <dd>
                    All text is printed
                    left-to-right independent of the codepage selected. To write strings in a language that
                    is written right-to-left, the logical character sequence must be inverted so that
                    the order appears correct visually. While this is inconvenient, it is in line with the behaviour of GW-BASIC.
                    This affects code pages marked with <i>B</i> in the table.
                </dd>

                <dt id="combi">
                    Combining characters
                </dt>
                <dd>
                    PC-BASIC recognises single-byte code points (where each glyph shows on a single cell on the screen) and
                    double-byte code points (where a single glyph takes up two cells on the screen). Combining characters
                    (such as the combining diacritics of codepages <code>874</code> and <code>1258</code>) are therefore not
                    shown correctly: instead of being combined with their preceding base character as a single combined glyph,
                    such combinations will be shown as separate glyphs. Where available, alternative codepages with precomposed
                    characters will give better results. This affects code pages marked with <i>C</i> in the table.
                </dd>
            
            <p>
                The following codepages are available. PC-BASIC uses the Microsoft OEM codepage number where
                this is unambiguous. The code pages are expected to agree with Microsoft sources for the ranges
                <code>&amp;H80</code>&#8211;<code>&amp;HFF</code>. Ranges <code>&amp;H00</code>&#8211;<code>&amp;H1F</code>
                and <code>&amp;H7F</code> are implemented as the IBM Special Graphic Characters where some
                code page sources will list these as the corresponding control characters.
                For unofficial codepages and those with conflicting numbering, codepage
                names are used instead of numbers.
            </p>
            <div class="scrollable"><table>
                <tr>
                    <th><code><var>codepage_id</var></code></th>
                    <th>Codepage</th>
                    <th>Languages</th>
                    <th>Notes</th>
                </tr>
                <tr>
                    <td><code>437</code></td>
                    <td>DOS Latin USA</td>
                    <td>English</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>720</code></td>
                    <td>Transparent ASMO</td>
                    <td>Arabic</td>
                    <td><a href="#bidi"><i>B</i></a></td>
                </tr>
                <tr>
                    <td><code>737</code></td>
                    <td>DOS Greek</td>
                    <td>Greek</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>775</code></td>
                    <td>DOS Baltic Rim</td>
                    <td>Estonian, Latvian and Lithuanian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>806</code></td>
                    <td>IBM-PC Devanagari</td>
                    <td>Hindi</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>850</code></td>
                    <td>DOS Latin 1</td>
                    <td>Western European languages</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>851</code></td>
                    <td>DOS Greek 1</td>
                    <td>Greek</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>852</code></td>
                    <td>DOS Latin 2</td>
                    <td>Central European languages</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>853</code></td>
                    <td>DOS Latin 3</td>
                    <td>Southern European languages</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>855</code></td>
                    <td>DOS Cyrillic 1</td>
                    <td>Serbian, Macedonian and Bulgarian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>856</code></td>
                    <td>DOS Hebrew</td>
                    <td>Hebrew</td>
                    <td><a href="#bidi"><i>B</i></a></td>
                </tr>
                <tr>
                    <td><code>857</code></td>
                    <td>DOS Latin 5</td>
                    <td>Turkish</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>858</code></td>
                    <td>DOS Latin 1 with Euro</td>
                    <td>Western European languages</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>860</code></td>
                    <td>DOS Portuguese</td>
                    <td>Portuguese</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>861</code></td>
                    <td>DOS Icelandic</td>
                    <td>Icelandic</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>862</code></td>
                    <td>DOS Hebrew</td>
                    <td>Hebrew</td>
                    <td><a href="#bidi"><i>B</i></a></td>
                </tr>
                <tr>
                    <td><code>863</code></td>
                    <td>DOS Canadian French</td>
                    <td>French</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>864</code></td>
                    <td>DOS Arabic</td>
                    <td>Arabic</td>
                    <td><a href="#bidi"><i>B</i></a></td>
                </tr>
                <tr>
                    <td><code>865</code></td>
                    <td>DOS Nordic</td>
                    <td>Danish and Norwegian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>866</code></td>
                    <td>DOS Cyrillic 2</td>
                    <td>Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>868</code></td>
                    <td>DOS Urdu</td>
                    <td>Urdu</td>
                    <td><a href="#bidi"><i>B</i></a></td>
                </tr>
                <tr>
                    <td><code>869</code></td>
                    <td>DOS Greek 2</td>
                    <td>Greek</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>874</code></td>
                    <td>TIS-620</td>
                    <td>Thai</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>932</code></td>
                    <td>Shift-JIS (variant)</td>
                    <td>Japanese</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>934</code></td>
                    <td>DOS/V Korea</td>
                    <td>Korean</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>936</code></td>
                    <td>GBK; GB2312/EUC-CN superset</td>
                    <td>Simplified Chinese</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>938</code></td>
                    <td>DOS/V Taiwan</td>
                    <td>Traditional Chinese</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>949</code></td>
                    <td>IBM-PC Korea KS; EUC-KR superset</td>
                    <td>Korean</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>950</code></td>
                    <td>Big-5 (variant)</td>
                    <td>Traditional Chinese</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>1258</code></td>
                    <td>Vietnamese</td>
                    <td>Vietnamese</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>alternativnyj</code></td>
                    <td>GOST Alternativnyj Variant</td>
                    <td>Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>armscii8a</code></td>
                    <td>ArmSCII-8a; FreeDOS cp899</td>
                    <td>Armenian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>big5-2003</code></td>
                    <td>Big-5 (Taiwan 2003)</td>
                    <td>Traditional Chinese</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>big5-hkscs</code></td>
                    <td>Big-5 (Hong Kong 2008)</td>
                    <td>Traditional Chinese</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>georgian-academy</code></td>
                    <td>Academy Standard</td>
                    <td>Georgian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>georgian-ps</code></td>
                    <td>Parliament Standard</td>
                    <td>Georgian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>iransystem</code></td>
                    <td>Iran System</td>
                    <td>Persian</td>
                    <td><a href="#bidi"><i>B</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-as</code></td>
                    <td>ISCII Assamese</td>
                    <td>Assamese</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-be</code></td>
                    <td>ISCII Bengali</td>
                    <td>Bengali</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-de</code></td>
                    <td>ISCII Devanagari</td>
                    <td>Hindi, Marathi, Sanskrit, Konkani, Nepali</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-gu</code></td>
                    <td>ISCII Gujarati</td>
                    <td>Gujarati</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-ka</code></td>
                    <td>ISCII Kannada</td>
                    <td>Kannada</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-ma</code></td>
                    <td>ISCII Malayalam</td>
                    <td>Malayalam</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-or</code></td>
                    <td>ISCII Oriya</td>
                    <td>Oriya</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-pa</code></td>
                    <td>ISCII Punjabi</td>
                    <td>Punjabi</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-ta</code></td>
                    <td>ISCII Tamil</td>
                    <td>Tamil</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>iscii-te</code></td>
                    <td>ISCII Telugu</td>
                    <td>Telugu</td>
                    <td><a href="#combi"><i>C</i></a></td>
                </tr>
                <tr>
                    <td><code>kamenicky</code></td>
                    <td>Kamenick&#253;; cp895</td>
                    <td>Czech</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>koi8-r</code></td>
                    <td>KOI8-R</td>
                    <td>Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>koi8-ru</code></td>
                    <td>KOI8-RU</td>
                    <td>Ukrainian, Belarusian, Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>koi8-u</code></td>
                    <td>KOI8-U</td>
                    <td>Ukrainian, Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>mazovia</code></td>
                    <td>Mazovia; cp667, 991, 790</td>
                    <td>Polish</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>mik</code></td>
                    <td>MIK, FreeDOS cp3021</td>
                    <td>Bulgarian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>osnovnoj</code></td>
                    <td>GOST Osnovnoj Variant</td>
                    <td>Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>pascii</code></td>
                    <td>PASCII</td>
                    <td>Kashmiri, Persian, Sindhi, Urdu</td>
                    <td><a href="#bidi"><i>B</i></a></td>
                </tr>
                <tr>
                    <td><code>ruscii</code></td>
                    <td>RUSCII</td>
                    <td>Ukrainian, Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>russup3</code></td>
                    <td>Cornell Russian Support for DOS v3</td>
                    <td>Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>russup4ac</code></td>
                    <td>Exceller Software Russian Support for DOS v4 Academic</td>
                    <td>Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>russup4na</code></td>
                    <td>Exceller Software Russian Support for DOS v4 Non-Academic</td>
                    <td>Russian</td>
                    <td></td>
                </tr>
                <tr>
                    <td><code>viscii</code></td>
                    <td>VISCII, FreeDOS cp30006</td>
                    <td>Vietnamese</td>
                    <td></td>
                </tr>
            </table></div>
            <p>
                You can add custom codepages to PC-BASIC, by adding a file with
                its mapping to Unicode to the <code>codepage/</code> directory.
            </p>
        </dl></section>
        <hr>

        <section>
            <h4 id="fonts">Fonts</h4>
            <p>
                PC-BASIC emulates the distinctive raster fonts of IBM-compatible machines. The ROM
                fonts of the original IBM and Tandy adapters (which are in the public
                domain in a number of countries) have been included in PC-BASIC. These provide the most
                accurate emulation. However, the font ROMs only included a single code page &#8211;
                DOS Latin USA 437.
            </p>
            <p>
                To support code pages beyond 437, PC-BASIC defaults to the <strong>CPIDOS</strong> font used by
                default in FreeDOS and DOSBox. This font is very similar in style to the IBM VGA
                font but has support for many more code pages, in particular Western and Middle
                Eastern alphabets. If CPIDOS does not include the characters you need, PC-BASIC
                tries to find them in <strong>UNI-VGA</strong>, which is also very similar in style to VGA.
                If that does not suffice, PC-BASIC falls back to <strong>GNU UniFont</strong> for the
                missing characters. UniFont's Western glyphs are less similar to the VGA font, but
                it provides support for the full Unicode Basic Multilingual Plane. For example, all Chinese,
                Japanese and Korean glyphs in PC-BASIC are taken from UniFont.
            </p>
            <p>
                It is possible to change the choice of font using the <code><a href="#--font">font=</a></code> option.
                You can provide a list of fonts, where the last font specified is the
                most preferred one.
            </p>
            <p>
                PC-BASIC reads fonts in the <code>.hex</code> format introduced by UniFont. It's
                easy to define custom fonts in this format: it can be edited in a regular text editor.
                See the UniFont project for an authoring tool. You can add custom fonts to PC-BASIC by
                installing them into the <code>font/</code> subdirectory of PC-BASIC's installation
                directory.
            </p>
            <p>
                By default, the following fonts
                are available:
            </p>
            <div class="scrollable"><table>
                <tr>
                    <th><code><var>font_name</var></code></th>
                    <th>Name</th>
                    <th>Sizes</th>
                    <th>Codepages</th>
                </tr>
                <tr>
                    <td><code>unifont</code></td>
                    <td>GNU UniFont</td>
                    <td>16</td>
                    <td>all</td>
                </tr>
                <tr>
                    <td><code>univga</code></td>
                    <td>Uni-VGA font</td>
                    <td>16</td>
                    <td>many</td>
                </tr>
                <tr>
                    <td><code>freedos</code></td>
                    <td>FreeDOS CPIDOS font</td>
                    <td>8, 14, 16</td>
                    <td>many</td>
                </tr>
                <tr>
                    <td><code>cga</code></td>
                    <td>IBM Colour/Graphics Adapter font</td>
                    <td>8</td>
                    <td>437 only</td>
                </tr>
                <tr>
                    <td><code>mda</code></td>
                    <td>IBM Monochrome Display Adapter font</td>
                    <td>14</td>
                    <td>437 only</td>
                </tr>
                <tr>
                    <td><code>vga</code></td>
                    <td>IBM Video Graphics Array font</td>
                    <td>8, 14, 16</td>
                    <td>437 only</td>
                </tr>
                <tr>
                    <td><code>olivetti</code></td>
                    <td>Olivetti/AT&amp;T font</td>
                    <td>16</td>
                    <td>437 only</td>
                </tr>
                <tr>
                    <td><code>tandy1</code></td>
                    <td>Tandy-1000 font old version</td>
                    <td>8</td>
                    <td>437 only</td>
                </tr>
                <tr>
                    <td><code>tandy2</code></td>
                    <td>Tandy-1000 font new version</td>
                    <td>8</td>
                    <td>437 only</td>
                </tr>
            </table></div>
            <p>
                GNU UniFont contains glyphs for all the defined code points of the
                Basic Multilingual Plane of Unicode 7.0, which makes it an
                excellent fallback font. Its glyphs are not, however, very similar
                to those that were used on DOS machines; both Uni-VGA and the
                FreeDOS CPIDOS fonts are therefore more suitable, when they have
                the required glyphs.
            </p>
        </section>
        <hr>

        <section>
        <h4 id="redirecting">Redirecting I/O</h4>
            <p>
                PC-BASIC supports redirecting input and output the GW-BASIC way: output redirected
                with the <code><a href="#--output">output</a>=</code> option will be sent to the screen as well as
                the specified file, while input redirected with <code><a href="#--input">input=</a></code> is taken
                only from the specified file. Note that screen output through the
                <code>SCRN:</code> device and keyboard input through the <code>KYBD:</code>
                device are not redirected. Files are read and written in the codepage set with
                PC-BASIC.
            </p>

            <p>
                Note that it is also possible to use your operating system's facility to
                redirect console output using the <code>&lt;</code> and <code>&gt;</code>
                operators. It's best to set <code><b><a href="#--interface">interface</a>=none</b></code> so that I/O is
                redirected through the console. This will produce files in your console's standard encoding,
                which is often UTF-8 on Unix and Windows-1252 on Windows.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="cli">Command-line interface</h4>
            <p>
                You can run PC-BASIC as a
                command-line interface by setting the <code><a href="#--interface">interface</a>=cli</code> (or
                <code><a href="#-b">-b</a></code>) option. No window will be opened: you can type BASIC commands
                straight into your Command Prompt/Terminal. Use the horizontal arrow keys to
                move on the current line you're editing; use the vertical arrow keys to show
                screen rows above and below. Copy and paste are available only if the calling
                shell provides them. On Windows, <kbd>Ctrl</kbd>+<kbd>Break</kbd> will
                terminate PC-BASIC immediately. You can use <kbd>Ctrl</kbd>+<kbd>C</kbd> to
                interrupt the program. The end-of-file key combination
                (<kbd>Ctrl</kbd>+<kbd>D</kbd> on Unix, <kbd>Ctrl</kbd>+<kbd>Z</kbd> on Windows)
                will exit PC-BASIC.
            </p>
            <p>
                You can use the command-line interface to run one or a few BASIC commands directly, like so:
            </p>
<pre><samp>me@mybox$ <b>pcbasic -bqe="?1+1"</b>
 <b>2</b>
me@mybox$
</samp></pre>
            <p>
                For scripting purposes, it is also possible to run PC-BASIC without any
                interface by setting <code><a href="#--interface">interface</a>=none</code> or
                <code><a href="#-n">-n</a></code>. If this is
                set, PC-BASIC will take input from and send output to the console as UTF-8
                without further modification. This is useful in combination with redirection and
                pipes.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="curses">Text-based interface</h4>
            <p>
                There is also a full-screen text interface available: enable it
                by setting <code><a href="#--interface">interface</a>=text</code> (or <code><a href="#-t">-t</a></code>). The text-based
                interface is very similar to the default graphical interface, but runs in your
                Command Prompt or Terminal window.
            </p>

            <p>
                In the text-based and command-line interfaces, graphics are not available.
                Attempting to open a graphical screen mode will lead to an <samp>Illegal
                function call</samp> error. Furthermore, many <kbd>Ctrl</kbd> and <kbd>Alt</kbd>
                key combinations are not available.
            </p>

            <p>
                On Unix systems only, you can get sound in the text and command-line
                interfaces over the PC speaker if you install the <code>beep</code> utility and
                enable the legacy PC-speaker driver or emulation.
            </p>
        </section>
        <hr>
    </section>

    <section>
        <h3 id="gwbasic">Differences with GW-BASIC</h3>
        <p>
            GW-BASIC was a real-mode DOS program, which means that it had full control
            over an IBM-compatible 8086 computer. It had direct access to all areas of
            memory and all devices. Some BASIC programs used this fact, by using
            <code><a href="#POKE">POKE</a></code> and <code><a href="#OUT">OUT</a></code>
            statements as well as <code><a href="#CALL">CALL</a></code>
            and <code><a href="#USR">USR</a></code> machine-code subroutines to perform tasks for which BASIC
            did not provide support. PC-BASIC runs on modern machines which may be based on
            completely different architectures and anyway do not allow applications to
            directly access memory or devices. Therefore, it is not possible to run machine
            code on PC-BASIC. If you need machine code, you'll need to use full CPU
            emulation such as provided by DOSBox, Bochs or VirtualBox.
        </p>

        <section>
            <h4 id="gwbasic-language">Language differences</h4>
            <p>
                PC-BASIC <em>does</em> provide limited support for the <code><a href="#POKE">POKE</a></code> and <code><a href="#PEEK">PEEK</a></code> statements: some of the most commonly accessed
                regions of memory are emulated and can be read and (sometimes) written. There is
                read and write support for video memory, font RAM and selected locations of the
                low memory segment, including the keyboard buffer. Additionally, there is read
                support for font ROM, variable, array and string memory, <code><a href="#FIELD">FIELD</a></code>
                buffers as well as the program code itself. Writing into the program code is
                disabled by default, but can be enabled with the <code><a href="--allow-code-poke">allow-code-poke</a></code>
                option. Use with care. A number of machine ports related to keyboard input and
                video modes are supported as well.
            </p>
            <p>
                The <code><a href="SHELL">SHELL</a></code> statement is, by default,
                disabled; this is to avoid unpleasant surprises. In GW-BASIC under MS-DOS,
                <code>SHELL</code> opens a DOS prompt or executes commands in it. The command
                shells of modern operating systems work differently than those of DOS; in
                particular, it is impossible to retrieve changes in the environment variables,
                so that many use cases of <code>SHELL</code> simply would not work; for
                example, changing the current drive on Windows. Moreover, Unix shells have a
                syntax that is completely different from that of DOS. You can, however, enable
                <code>SHELL</code> by setting the <code><b><a href="#--shell">shell</a>=native</b></code> option. Use with
                care.
            </p>
            <div class="scrollable">
                <table>
                    <tr>
                        <th>Statement</th>
                        <th>Support level</th>
                    </tr>
                    <tr>
                        <td><code><a href="#BLOAD">BLOAD</a></code></td>
                        <td>Selected memory areas supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#BSAVE">BSAVE</a></code></td>
                        <td>Selected memory areas supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#CALL">CALL</a></code></td>
                        <td>Not supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#CALLS">CALLS</a></code></td>
                        <td>Not supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#DEF-USR">DEF USR</a></code></td>
                        <td>Not supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#ERDEV">ERDEV</a></code></td>
                        <td>Not supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#EXTERR">EXTERR</a></code></td>
                        <td>Not supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#INP">INP</a></code></td>
                        <td>Selected ports supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#IOCTL">IOCTL</a></code>, <code><a href="#IOCTL%24">IOCTL$</a></code></td>
                        <td>Not supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#OUT">OUT</a></code></td>
                        <td>Selected ports supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#PEEK">PEEK</a></code></td>
                        <td>Selected memory areas supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#POKE">POKE</a></code></td>
                        <td>Selected memory areas supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#SHELL">SHELL</a></code></td>
                        <td>Supported through OS-native shell if <code><b><a href="#--shell">shell</a>=native</b></code> is set.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#USR">USR</a></code></td>
                        <td>Not supported.</td>
                    </tr>
                    <tr>
                        <td><code><a href="#WAIT">WAIT</a></code></td>
                        <td>Selected ports supported.</td>
                    </tr>
                </table>
            </div>
            <p>
                The highest level of compatibility with GW-BASIC can be attained by setting
                <code><a href="#--preset">preset</a>=strict</code>,
                which switches off all convenience and security features that cause differences with
                GWBASIC.
            </p>
        </section>
        <hr>

        <section>
            <h4 id="gwbasic-devices">Devices</h4>
            <p>
                GW-BASIC additionally recognises the following little-used device, which is not implemented in PC-BASIC.
            </p>
            <div class="scrollable">
                <table>
                    <tr>
                        <th>Device</th>
                        <th>Allowed modes</th>
                        <th>Description</th>
                    </tr>
                    <tr>
                        <td><code>CONS:</code></td>
                        <td><code>OUTPUT</code></td>
                        <td>
                            The screen (console). Output to <code>CONS:</code> is displayed
                            directly at the cursor position when <kbd>Enter</kbd> is
                            pressed. It does not update the end-of-line value
                            for the interpreter, which means that it does not
                            move with <kbd>Backspace</kbd> or <kbd>Del</kbd> and is not
                            stored in program lines if it appears beyond the
                            end of the existing line. <code>CONS:</code> can be opened with
                            any access mode, but the effect is always to open
                            it for <code>OUTPUT</code>.
                        </td>
                    </tr>
                </table>
            </div>
        </section>
        <hr>

        <section>
            <h4 id="gwbasic-options">Command-line options</h4>
            <p>
                GW-BASIC recognised a number of options on the command-line.
                These are matched by PC-BASIC with only minor modifications:
            </p>
            <div class="scrollable">
                <table>
                    <tr>
                        <th>
                        GW-BASIC option
                        </th>
                        <th>
                        PC-BASIC short option
                        </th>
                        <th>
                        PC-BASIC option
                        </th>
                        <th>
                        Effect
                        </th>
                    </tr>
                    <tr>
                        <td><code>/d</code></td>
                        <td><code><b><a href="#-d">-d</a></b></code></td>
                        <td><code><b><a href="#--double">--double</a></b></code></td>
                        <td>Enable double-precision floating-point math functions.</td>
                    </tr>
                    <tr>
                        <td><code>/f:<var>n</var></code></td>
                        <td><code><b><a href="#-f">-f</a>=</b><var>n</var></code></td>
                        <td><code><b><a href="#--max-files">--max-files</a>=</b><var>n</var></code></td>
                        <td>Set the maximum number of open files.</td>
                    </tr>
                    <tr>
                        <td><code>/s:<var>n</var></code></td>
                        <td><code><b><a href="#-s">-s</a>=</b><var>n</var></code></td>
                        <td><code><b><a href="#--max-reclen">--max-reclen</a>=</b><var>n</var></code></td>
                        <td>Set the maximum record length for <code>RANDOM</code> files.</td>
                    </tr>
                    <tr>
                        <td><code>/c:<var>n</var></code></td>
                        <td><code><b><a href="#-c">-c</a>=</b><var>n</var></code></td>
                        <td><code><b><a href="#--serial-buffer-size">--serial-buffer-size</a>=</b><var>n</var></code></td>
                        <td>Set the size of the receive buffer for <code>COM</code> devices.</td>
                    </tr>
                    <tr>
                        <td><code>/i:<var>n</var></code></td>
                        <td><code><b><a href="#-i">-i</a>=</b><var>n</var></code></td>
                        <td></td>
                        <td>No effect.</td>
                    </tr>
                    <tr>
                        <td><code>/m:<var>n</var>,<var>m</var></code></td>
                        <td><code><b><a href="#-m">-m</a>=</b><var>n</var>,<var>m</var></code></td>
                        <td><code><b><a href="#--max-memory">--max-memory</a>=</b><var>n</var>,<var>m</var></code></td>
                        <td>
                            Set the highest memory location to <code><var>n</var></code> and maximum
                            BASIC memory size to <code><var>m</var>*16</code> bytes.
                        </td>
                    </tr>
                    <tr>
                        <td><code>&gt;<var>filename</var></code></td>
                        <td></td>
                        <td><code><b><a href="#--output">--output</a>=</b><var>filename</var></code></td>
                        <td>Write screen output to <code><var>filename</var></code>.</td>
                    </tr>
                    <tr>
                        <td><code>&gt;&gt;<var>filename</var></code></td>
                        <td></td>
                        <td><code><b>--output=</b><var>filename</var> <b><a href="#--append">--append</a></b></code></td>
                        <td>Append screen output to <code><var>filename</var></code>.</td>
                    </tr>
                    <tr>
                        <td><code>&lt;<var>filename</var></code></td>
                        <td></td>
                        <td><code><b><a href="#--input">--input</a>=</b><var>filename</var></code></td>
                        <td>Read keyboard input from <code><var>filename</var></code>.</td>
                    </tr>
                </table>
            </div>
        </section>
        <hr>
    </section>
</article>
<article>
<!--
    PC-BASIC documentation
    Copyright (c) 2014-2015 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->

<h2 id="settings">Settings and options</h2>
<p>
    PC-BASIC has a number of settings that change the way it operates.
    These settings can be changed by setting options on the command line
    or through editing the configuration file.
</p>
<p>
    In either method, the options have the same name and syntax. In what follows, we will often refer to
    a particular option setting; remember that you can set this from the command line as well as from the configuration file.
</p>
<h5>Command-line options</h5>
<p>
    You can enter command-line options if you start PC-BASIC from the console
    (also known as the <em>Command Prompt</em> or <em>Terminal</em>;
    this is normally <code>CMD</code> or <code>PowerShell</code> on Windows),
    by preceding the name of the option
    with two dashes, like so:
</p>
<code class="block"><b>pcbasic <a href="#--preset">--preset</a>=tandy <a href="#--ctrl-c-break">--ctrl-c-break</a>=True</b></code>
<p>
    On the command line, you can leave out the expression <code><b>=True</b></code>
    that is common in switching options.
    Some options have an alternative, short name consisting of a single
    letter preceded by a single dash, which you can use on the command line.
    You can combine multiple short options with a single dash.
</p>
<h5>Configuration files</h5>
<p>
    You can change options by adding or removing lines in your local configuration file,
    which can be found in the following location:
</p>
<dl>
    <dt>Windows</dt><dd><code>%AppData%\pcbasic\PCBASIC.INI</code></dd>
    <dt>OS X</dt><dd><code>~/Library/Application Support/pcbasic/PCBASIC.INI</code></dd>
    <dt>Linux</dt><dd><code>~/.config/pcbasic/PCBASIC.INI</code></dd>
</dl>
<p>
    Change an option in the configuration file by adding a line in the section named <code>[pcbasic]</code>, like so:
</p>
<code class="block">
    [pcbasic]<br>
    <a href="#--preset">preset</a>=tandy<br>
    <a href="#--ctrl-c-break">ctrl-c-break</a>=True
</code>
<p>
    You cannot use  <a href="#parameters">positional arguments</a> or
    the short name of options in the configuration file.
    You also cannot leave out the expression <code><b>=True</b></code>.
</p>
<hr>
<!--
    PC-BASIC documentation
    Copyright (c) 2014-2015 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->

<section>
    <h3 id="synopsis">Synopsis</h3>
    <code class="block">
        <b>pcbasic</b>
        [<var><a href="#p-program">program</a></var>|<var><a href="#p-package">package</a></var>
        [<var><a href="#p-output">output</a></var>]]
        <span><a href="#--allow-code-poke">[<b>--allow-code-poke</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--altgr">[<b>--altgr</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--append">[<b>--append</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--aspect">[<b>--aspect=</b><var>x</var>,<var>y</var>]</a>
<a href="#-b">[<b>-b</b>]</a>
<a href="#--border">[<b>--border=</b><var>width</var>]</a>
<a href="#--caption">[<b>--caption=</b><var>title</var>]</a>
<a href="#--capture-caps">[<b>--capture-caps</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--cas1">[<b>--cas1=</b><var>type</var><b>:</b><var>value</var>[<b>:</b><var>loc</var>]]</a>
<a href="#--cga-low">[<b>--cga-low</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--codepage">[<b>--codepage=</b><var>codepage_id</var>]</a>
<a href="#--config">[<b>--config=</b><var>config_file</var>]</a>
<a href="#--com1">[<b>--com1=</b><var>type</var><b>:</b><var>value</var>]</a>
<a href="#--com2">[<b>--com2=</b><var>type</var><b>:</b><var>value</var>]</a>
<a href="#--convert">[<b>--convert=</b>{<b>A</b>|<b>B</b>|<b>P</b>}]</a>
<a href="#--copy-paste">[<b>--copy-paste=</b><var>copy_button</var><b>,</b><var>paste_button</var>]</a>
<a href="#--ctrl-c-break">[<b>--ctrl-c-break</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--current-device">[<b>--current-device=</b>{<b>CAS1</b>|<b>@</b>|<b>A</b>|<b>B</b> ... |<b>Z</b>}]</a>
<a href="#--dimensions">[<b>--dimensions=</b><var>x</var>,<var>y</var>]</a>
<a href="#--double">[<b>-d</b>]</a>
<a href="#--double">[<b>--double</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--exec">[<b>-e=</b><var>command_line</var>]</a>
<a href="#--exec">[<b>--exec=</b><var>command_line</var>]</a>
<a href="#--font">[<b>--font=</b><var>font_name</var>[<b>,</b><var>font_name</var> ... ]]</a>
<a href="#--fullscreen">[<b>--fullscreen</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--help">[<b>-h</b>]</a>
<a href="#--help">[<b>--help</b>]</a>
<a href="#-i">[<b>-i</b>]</a>
<a href="#--input">[<b>--input=</b><var>input_file</var>]</a>
<a href="#--interface">[<b>--interface=</b>{<b>none</b>|<b>cli</b>|<b>text</b>|<b>graphical</b>}]</a>
<a href="#--keys">[<b>-k=</b><var>keystring</var>]</a>
<a href="#--keys">[<b>--keys=</b><var>keystring</var>]</a>
<a href="#--load">[<b>-l=</b><var>program</var>]</a>
<a href="#--load">[<b>--load=</b><var>program</var>]</a>
<a href="#--logfile">[<b>--logfile=</b><var>log_file</var>]</a>
<a href="#--lpt1">[<b>--lpt1=</b><var>type</var><b>:</b><var>value</var>]</a>
<a href="#--lpt2">[<b>--lpt2=</b><var>type</var>:<var>value</var>]</a>
<a href="#--lpt3">[<b>--lpt3=</b><var>type</var>:<var>value</var>]</a>
<a href="#--map-drives">[<b>--map-drives</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--max-files">[<b>-f=</b><var>number_of_files</var>]</a>
<a href="#--max-files">[<b>--max-files=</b><var>number_of_files</var>]</a>
<a href="#--max-memory">[<b>-m=</b><var>max_memory</var>[<b>,</b><var>basic_memory_blocks</var>]]</a>
<a href="#--max-memory">[<b>--max-memory=</b><var>max_memory</var>[<b>,</b><var>basic_memory_blocks</var>]]</a>
<a href="#--max-reclen">[<b>-s=</b><var>record_length</var>]</a>
<a href="#--max-reclen">[<b>--max-reclen=</b><var>record_length</var>]</a>
<a href="#--monitor">[<b>--monitor=</b>{<b>rgb</b>|<b>composite</b>|<b>mono</b>}]</a>
<a href="#--mono-tint">[<b>--mono-tint=</b><var>r</var><b>,</b><var>g</var><b>,</b><var>b</var>]</a>
<a href="#--mount">[<b>--mount=</b><var>drive</var><b>:</b><var>path</var><b>,</b>[<var>drive</var><b>:</b><var>path</var> ... ]]</a>
<a href="#-n">[<b>-n</b>]</a>
<a href="#--nobox">[<b>--nobox</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--nokill">[<b>--nokill</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--nosound">[<b>--nosound</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--output">[<b>--output=</b><var>output_file</var>]</a>
<a href="#--pcjr-term">[<b>--pcjr-term=</b><var>terminal_program</var>]</a>
<a href="#--peek">[<b>--peek=</b>[<var>seg</var><b>:</b><var>addr</var><b>:</b><var>val</var>[<b>,</b><var>seg</var><b>:</b><var>addr</var><b>:</b><var>val</var> ... ]]]</a>
<a href="#--pen">[<b>--pen=</b>{<b>left</b>|<b>middle</b>|<b>right</b>|<b>none</b>}]</a>
<a href="#--preset">[<b>--preset=</b><var>option_block</var>]</a>
<a href="#--print-trigger">[<b>--print-trigger=</b>{<b>line</b>|<b>page</b>|<b>close</b>}]</a>
<a href="#--quit">[<b>-q</b>]</a>
<a href="#--quit">[<b>--quit</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--reserved-memory">[<b>--reserved-memory=</b><var>number_of_bytes</var>]</a>
<a href="#--resume">[<b>--resume</b>[<b>=True</b>|<b>=False</b>]</a>
<a href="#--run">[<b>-r=</b><var>program</var>]</a>
<a href="#--run">[<b>--run=</b><var>program</var>]</a>
<a href="#--scaling">[<b>--scaling=</b>{<b>smooth</b>|<b>crisp</b>|<b>native</b>}]</a>
<a href="#--serial-buffer-size">[<b>-c=</b><var>size</var>]</a>
<a href="#--serial-buffer-size">[<b>--serial-buffer-size=</b><var>size</var>]</a>
<a href="#--shell">[<b>--shell=</b>{<b>none</b>|<b>native</b>|<var>command</var>]]</a>
<a href="#--state">[<b>--state=</b><var>state_file</var>]</a>
<a href="#--strict-hidden-lines">[<b>--strict-hidden-lines</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--strict-newline">[<b>--strict-newline</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--strict-protect">[<b>--strict-protect</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--syntax">[<b>--syntax=</b>{<b>advanced</b>|<b>pcjr</b>|<b>tandy</b>}]</a>
<a href="#-t">[<b>-t</b>]</a>
<a href="#--text-width">[<b>--text-width=</b>{<b>40</b>|<b>80</b>}]</a>
<a href="#--utf-8">[<b>--utf8</b>[<b>=True</b>|<b>=False</b>]]</a>
<a href="#--version">[<b>-v</b>]</a>
<a href="#--version">[<b>--version</b>]</a>
<a href="#--video">[<b>--video=</b><var>card</var>]</a>
<a href="#--video-memory">[<b>--video-memory=</b><var>size</var>]</a>
<a href="#--wait">[<b>-w</b>]</a>
<a href="#--wait">[<b>--wait</b>[<b>=True</b>|<b>=False</b>]]</a>
</span></code>
</section>
<hr>

<section>
    <h3 id="parameters">Positional arguments</h3>
    <dl>
        <dt id="p-program"><code><var>program</var></code></dt>
        <dd>
            If a <code>.BAS</code> program is specified as the first positional argument,
            it will be run.
            The
            <code><b><a href="#--run">--run</a></b></code>,
            <code><b><a href="#--load">--load</a></b></code> and
            <code><b><a href="#--convert">--convert</a></b></code> options
            override this behaviour.
        </dd>

        <dt id="p-package"><code><var>package</var></code></dt>
        <dd>
            If a zipfile <a href="#packages">package</a> or directory is specified as the first positional argument,
            any contained <a href="#settings">configuration file <code>PCBASIC.INI</code></a>
            will be loaded; usually, it will run a program file in the package.
            All other command-line options will override the package configuration file,
            note in particular the potential of the
            <code><b><a href="#--run">--run</a></b></code>,
            <code><b><a href="#--load">--load</a></b></code> and
            <code><b><a href="#--convert">--convert</a></b></code> options
            to alter the behaviour of the package.
        </dd>

        <dt id="p-output"><code><var>output</var></code></dt>
        <dd>
            If a second positional argument is specified, it sets the output file for file format conversion.
            This argument is ignored unless the <code><a href="#--convert">--convert</a></code> option is given.
        </dd>
    </dl>
</section>
<hr>

<section>
    <h3 id="options">Options</h3>
    <dl>
        <dt id="--allow-code-poke">
            <code><b>--allow-code-poke</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Allow programs to <code><a href="#POKE">POKE</a></code> into code memory.
        </dd>

        <dt id="--altgr">
            <code><b>--altgr</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            If <code><b>True</b></code> (default), interpret the right
            <kbd>Alt</kbd> key as <kbd>Alt Gr</kbd> instead of <kbd>Alt</kbd>.
            The left <kbd>Alt</kbd> key is always seen as <kbd>Alt</kbd>.
        </dd>

        <dt id="--append">
            <code><b>--append</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            If used with
            <code><b><a href="#--output">--output</a>=</b><var>output_file</var></code>,
            the <code><var>output_file</var></code> is appended to rather than overwritten.
        </dd>

        <dt id="--aspect">
            <code><b>--aspect=</b><var>x</var>,<var>y</var></code>
        </dt>
        <dd>
            Set the display aspect ratio to <code><var>x</var></code>:<code><var>y</var></code>.
            Only has an effect if combined with <code><b><a href="#--interface">--interface</a>=graphical</b></code>.
        </dd>

        <dt id="-b">
            <code><b>-b</b></code>
        </dt>
        <dd>
            Use the command-line interface. This is identical to
            <code><b><a href="#--interface">--interface</a>=cli</b></code>.
        </dd>

        <dt id="--border">
            <code><b>--border=</b><var>width</var></code>
        </dt>
        <dd>
            Set the width of the screen border as a
            percentage from 0&#8212;100. The percentage refers to the total
            width of the borders on both sides as a fraction of the usable
            screen width.
            Only has an effect if combined with <code><b><a href="#--interface">--interface</a>=graphical</b></code>.
        </dd>

        <dt id="--caption">
            <code><b>--caption=</b><var>title</var></code>
        </dt>
        <dd>
            Set the title bar caption of the PC-BASIC window.
            Default <code><var>title</var></code> is <em>PC-BASIC</em>.
        </dd>

        <dt id="--capture-caps">
            <code><b>--capture-caps</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Let PC-BASIC handle the <kbd>Caps Lock</kbd> key. This
            may or may not interfere with the operating system's own handling of that key.
            Only has an effect if combined with <code><b><a href="#--interface">--interface</a>=graphical</b></code>.
        </dd>

        <dt id="--cas1">
            <code><b>--cas1=</b><var>type</var><b>:</b><var>value</var>[<b>:</b><var>loc</var>]</code>
        </dt>
        <dd>
            Attach a resource to the <code>CAS1:</code> cassette device
            and wind the virtual tape to <code><var>loc</var></code> seconds.
            <code><var>type</var><b>:</b><var>value</var></code> can be
            <dl>
                <dt><code><b>WAV:</b><var>wav_file</var></code></dt>
                <dd>
                    Connect to the RIFF Wave file <code><var>wav_file</var></code>
                    with data modulated in IBM PC cassette format.
                </dd>

                <dt><code><b>CAS:</b><var>cas_file</var></code></dt>
                <dd>
                    Connect to the PCE/PC-BASIC CAS tape image
                    <code><var>cas_file</var></code>.
                </dd>

                <dt><code><b>BC:</b><var>wav_file</var></code></dt>
                <dd>
                    Connect to the RIFF Wave file <code><var>wav_file</var></code>
                    with data modulated in BASICODE format.
                </dd>
            </dl>
        </dd>

        <dt id="--cga-low">
            <code><b>--cga-low</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Use low-intensity palettes in CGA modes.
            Only has an effect if combined with <code><b><a href="#--video">--video</a>=</b>{<b>cga</b>|<b>cga_old</b>|<b>ega</b>|<b>vga</b>}</code>.
        </dd>

        <dt id="--codepage">
            <code><b>--codepage=</b><var>codepage_id</var></code>
        </dt>
        <dd>
            Load the specified codepage. The codepage determines which
            characters are associated to a given character byte or, in the case
            of double-byte codepages, two character bytes. The available codepages are
            stored in the <code>codepage/</code> directory.
            See the <a href="#codepages">list of default available codepages</a> in the User's Guide.
        </dd>

        <dt id="--config">
            <code><b>--config=</b><var>config_file</var></code>
        </dt>
        <dd>
            Read a configuration file. The system default configuration is always
            read first, but any <a href="#--preset">preset</a> group of options
            in a configuration file replaces the whole equivalent default preset group.
        </dd>

        <dt id="--com1">
            <code><b>--com1=</b><var>type</var><b>:</b><var>value</var></code>
        </dt>
        <dd>
            Attach a resource to the <code>COM1:</code> serial device.
            <code><var>type</var><b>:</b><var>value</var></code> can be one of the following.
            <dl>
                <dt>
                    <code><b>PORT:</b><var>device_name</var></code>
                </dt>
                <dd>
                    Connect to a serial device. <code><var>device_name</var></code>
                    can be a device name such as <code>COM1</code> or
                    <code>/dev/ttyS0</code> or a number,
                    where the first serial port is number 0.
                </dd>
                <dt>
                    <code><b>SOCKET:</b><var>host</var><b>:</b><var>socket</var></code>
                </dt>
                <dd>
                    Connect to a TCP socket on a remote or
                    local host.
                </dd>
                <dt>
                    <code><b>STDIO</b>[<b>:</b>[<b>CRLF</b>]]</code>
                </dt>
                <dd>
                    Connect to standard I/O of the calling shell.
                    If <code><b>CRLF</b></code> is specified, PC-BASIC replaces <code>CR</code>
                    characters with <code>LF</code> on its output and <code>LF</code>
                    with <code>CR</code> on its input. This is more intuitive on Unix shells.
                    When using a Unix console, you should use <code>stty -icanon</code>
                    to enable PC-BASIC to read input correctly.
                </dd>
            </dl>
            If this option is not specified, the <code>COM1:</code> device is
            unavailable.
        </dd>

        <dt id="--com2">
            <code><b>--com2=</b><var>type</var><b>:</b><var>value</var></code>
        </dt>
        <dd>
            Attach a resource to the <code>COM2:</code> serial device. See
            <code><a href="#--com1">--com1</a></code>.
        </dd>

        <dt id="--convert">
            <code><b>--convert=</b>{<b>A</b>|<b>B</b>|<b>P</b>}</code></dt>
        <dd>
            Convert program to one of the following formats:
            <dl class="compact">
                <dt><code><b>A</b></code></dt>
                <dd>ASCII</dd>
                <dt><code><b>B</b></code></dt>
                <dd>Bytecode (tokenised)</dd>
                <dt><code><b>P</b></code></dt>
                <dd>Protected (encrypted)</dd>
            </dl>
            If <code><var><a href="#p-output">output</a></var></code> is not specified, write to
            standard output. If program is not specified, use the argument of
            <code><b><a href="#--run">--run</a></b></code> or
            <code><b><a href="#--load">--load</a></b></code>. If none of those are
            given, read from standard input. Overrides
            <code><b><a href="#--resume">--resume</a></b></code>,
            <code><b>--run</b></code> and <code><b>--load</b></code>.
        </dd>

        <dt id="--copy-paste">
            <code><b>--copy-paste=</b><var>copy_button</var><b>,</b><var>paste_button</var></code>
        </dt>
        <dd>
            Choose the mouse buttons for clipboard operations.
            <code><var>copy_button</var></code> and <code><var>paste_button</var></code> are
            chosen from <code><b>left</b></code>,<code><b>middle</b></code>,<code><b>right</b></code>,<code><b>none</b></code>.
        </dd>

        <dt id="--ctrl-c-break">
            <code><b>--ctrl-c-break</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            If <code><b>False</b></code>, follow GW-BASIC behaviour
            where <kbd>Ctrl</kbd>+<kbd>C</kbd> breaks <code><a href="#AUTO">AUTO</a></code>
            and <code><a href="#INPUT">INPUT</a></code> but not program execution or
            <code><a href="#LIST">LIST</a></code>.<br>
            If <code><b>True</b></code>, treat
            <kbd>Ctrl</kbd>+<kbd>C</kbd> exactly like
            <kbd>Ctrl</kbd>+<kbd>Break</kbd> and
            <kbd>Ctrl</kbd>+<kbd>Scroll Lock</kbd> when <code><b><a href="#--interface">--interface</a>=graphical</b></code>.<br>
            With <code><b><a href="#--interface">--interface</a>=</b>{<b>text</b>|<b>cli</b>}</code>,
            <kbd>Ctrl</kbd>+<kbd>C</kbd> is always treated like
            <kbd>Ctrl</kbd>+<kbd>Break</kbd>.<br>
            Default is <code><b>True</b></code>.
        </dd>

        <dt id="--current-device">
            <code><b>--current-device=</b>{<b>CAS1</b>|<b>@</b>|<b>A</b>|<b>B</b> ... |<b>Z</b>}</code></dt>
        <dd>
            Set the current device to the indicated PC-BASIC drive letter or
            <code><b>CAS1</b></code> for the cassette device. The device chosen
            should be mounted to an actual location using
            <code><a href="#--mount">--mount</a></code> (or <code><a href="#--cas1">--cas1</a></code> 
            if the cassette device is chosen). Default is <code><b>Z</b></code>,
            with the <code>Z:</code> device mounted to your current drive.
        </dd>

        <dt id="--dimensions">
            <code><b>--dimensions=</b><var>x</var>,<var>y</var></code>
        </dt>
        <dd>
            Set window dimensions to <code><var>x</var></code> by
            <code><var>y</var></code> pixels. This overrides
            <code><a href="#--scaling">--scaling</a>=native</code>
            and <code><a href="#--aspect">--aspect</a></code>.
            Only has an effect if combined with <code><b><a href="#--interface">--interface</a>=graphical</b></code>.
        </dd>

        <dt id="--double">
            <code id="-d"><b>-d</b></code>
            <code><b>--double</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Enable double-precision transcendental math functions. This is
            equivalent to the <code><b><a href="#gwbasic-options">/d</a></b></code> option in GW-BASIC.
        </dd>

        <dt id="--exec">
            <code id="-e"><b>-e=</b><var>command_line</var></code>
            <code><b>--exec=</b><var>command_line</var></code>
        </dt>
        <dd>
            Execute BASIC <code><var>command_line</var></code>. The specified
            commands are executed before entering into interactive mode or
            running a program.
        </dd>

        <dt id="--font">
            <code><b>--font=</b><var>font_name</var>[<b>,</b><var>font_name</var> ... ]</code></dt>
        <dd>
            Load <a href="#--codepage">current codepage</a>
            from specified <code>font_name.hex</code>
            fonts. The last fonts specified take precedence, previous ones are
            fallback. Default is <code><b>unifont,univga,freedos</b></code> (i.e. the
            <code>freedos.hex</code> font has preference). The available fonts
            depend on what is stored in <code>font/</code>.
        </dd>

        <dt id="--fullscreen">
            <code><b>--fullscreen</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Fullscreen mode.
            Only has an effect if combined with <code><b><a href="#--interface">--interface</a>=graphical</b></code>.
        </dd>

        <dt id="--help">
            <code id="-h"><b>-h</b></code>
            <code><b>--help</b></code>
        </dt>
        <dd>
            Show a usage message and exit.
        </dd>

        <dt id="-i">
            <code><b>-i</b></code>
        </dt>
        <dd>
            This option is ignored. It is included only for compatibility with
            GW-BASIC <code><b><a href="#gwbasic-options">/i</a></b></code>.
        </dd>

        <dt id="--input">
            <code><b>--input=</b><var>input_file</var></code>
        </dt>
        <dd>
            Retrieve keyboard input from <code><var>input_file</var></code>,
            except if <code>KYBD:</code> is read explicitly. Input from
            <code>KYBD:</code> files is always read from the keyboard,
            following GW-BASIC behaviour.
        </dd>

        <dt id="--interface">
            <code><b>--interface=</b>{<b>none</b>|<b>cli</b>|<b>text</b>|<b>graphical</b>}</code>
        </dt>
        <dd>
            Choose the type of interface. The following interface types are
            available:
            <dl class="compact">
                <dt><code><b>none</b></code></dt>
                <dd>Filter for use with pipes. Also <code><b><a href="#-n">-n</a></b></code>.</dd>
                <dt><code><b>cli</b></code></dt>
                <dd>Command-line interface. Also <code><b><a href="#-b">-b</a></b></code>.</dd>
                <dt><code><b>text</b></code></dt>
                <dd>Text-based interface. Also <code><b><a href="#-t">-t</a></b></code>.</dd>
                <dt><code><b>graphical</b></code></dt>
                <dd>Graphical interface.</dd>
            </dl>
            The default is <code><b>graphical</b></code>.
        </dd>

        <dt id="--keys">
            <code id="-k"><b>-k=</b><var>keystring</var></code>
            <code><b>--keys=</b><var>keystring</var></code>
        </dt>
        <dd>
            Insert the <code><var>keystring</var></code> into the keyboard buffer.
        </dd>

        <dt id="--load">
            <code id="-l"><b>-l=</b><var>program</var></code>
            <code><b>--load=</b><var>program</var></code>
        </dt>
        <dd>
            Start in interactive mode with the BASIC <code><var>program</var></code> loaded.
        </dd>

        <dt id="--logfile">
            <code><b>--logfile=</b><var>log_file</var></code>
        </dt>
        <dd>
            Write error and warning messages to
            <code><var>log_file</var></code> instead of <code>stderr</code>.
        </dd>

        <dt id="--lpt1">
            <code><b>--lpt1=</b><var>type</var><b>:</b><var>value</var></code>
        </dt>
        <dd>
            Attach a resource to the <code>LPT1:</code> parallel device.
            <code><var>type</var><b>:</b><var>value</var></code> can be
            <dl>
                <dt><code><b>PARPORT:</b><var>device_name</var></code></dt>
                <dd>
                    Connect to the parallel device <code><var>device_name</var></code>
                    such as <code><b>LPT1</b></code> or <code><b>/dev/parport0</b></code>.
                </dd>

                <dt><code><b>PRINTER:</b><var>printer_name</var></code></dt>
                <dd>
                    Connect to a Windows, LPR or CUPS printer. If
                    <code><var>printer_name</var></code> is not specified, the default
                    printer is used.
                </dd>

                <dt><code><b>FILE:</b><var>file_name</var></code></dt>
                <dd>
                    Connect to any file or to a Unix character device such as
                    <code><b>/dev/stdout</b></code>.
                </dd>

                <dt><code><b>STDIO</b>[<b>:</b>[<b>CRLF</b>]]</code></dt>
                <dd>
                    Connect to standard output of the calling shell.
                    If <code><b>CRLF</b></code> is specified, PC-BASIC replaces <code>CR</code>
                    characters with <code>LF</code> on its output. This is more intuitive on Unix shells.
                </dd>
            </dl>
            If this option is not specified, <code>LPT1:</code> is connected to the default printer.
        </dd>

        <dt id="--lpt2">
            <code><b>--lpt2=</b><var>type</var>:<var>value</var></code>
        </dt>
        <dd>
            Attach a resource to the <code>LPT2:</code> parallel device.
            See <code><b><a href="#--lpt1">--lpt1</a></b></code>.
            If this option is not specified, <code>LPT2:</code> is unavailable.
        </dd>

        <dt id="--lpt3">
            <code><b>--lpt3=</b><var>type</var>:<var>value</var></code>
        </dt>
        <dd>
            Attach a resource to the <code>LPT3:</code> parallel device.
            See <code><b><a href="#--lpt1">--lpt1</a></b></code>.
            If this option is not specified, <code>LPT3:</code> is unavailable.
        </dd>

        <dt id="--map-drives">
            <code><b>--map-drives</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            On Windows, assign all Windows drive letters to PC-BASIC drive
            letters. On other systems, assign to:
            <dl class="compact">
                <dt><code>Z:</code></dt>
                <dd>the current working directory</dd>
                <dt><code>C:</code></dt>
                <dd>the filesystem root</dd>
                <dt><code>H:</code></dt>
                <dd>the user's home directory.</dd>
            </dl>
        </dd>

        <dt id="--max-files">
            <code id="-f"><b>-f=</b><var>number_of_files</var></code>
            <code><b>--max-files=</b><var>number_of_files</var></code>
        </dt>
        <dd>
            Set maximum number of open files to
            <code><var>number_of_files</var></code>. This is
            equivalent to the <code><b><a href="#gwbasic-options">/f</a></b></code> option in GW-BASIC.
            Default is <code><b>3</b></code>.
        </dd>

        <dt id="--max-memory">
            <code id="-m"><b>-m=</b><var>max_memory</var>[<b>,</b><var>basic_memory_blocks</var>]</code>
            <code><b>--max-memory=</b><var>max_memory</var>[<b>,</b><var>basic_memory_blocks</var>]</code>
        </dt>
        <dd>
            Set the maximum size of the data memory segment to
            <code><var>max_memory</var></code> and the maximum size of the data
            memory available to BASIC to
            <code><var>basic_memory_blocks</var>*16</code>. In PC-BASIC, the
            minimum of these values is simply the data memory size; the two
            values are allowed for compatibility with the
            <code><b><a href="#gwbasic-options">/m</a></b></code> option in GW-BASIC.
        </dd>

        <dt id="--max-reclen">
            <code id="-s"><b>-s=</b><var>record_length</var></code>
            <code><b>--max-reclen=</b><var>record_length</var></code>
        </dt>
        <dd>
            Set maximum record length for <code>RANDOM</code> files to
            <code><var>record_length</var></code>. Default is <code><b>128</b></code>, maximum is
            <code><b>32767</b></code>. This is equivalent to the
            <code><b><a href="#gwbasic-options">/s</a></b></code> option in GW-BASIC.
        </dd>

        <dt id="--monitor">
            <code><b>--monitor=</b>{<b>rgb</b>|<b>composite</b>|<b>mono</b>}</code>
        </dt>
        <dd>
            Sets the monitor type to emulate. Available types are:
            <dl class="compact">
                <dt><code><b>rgb</b></code></dt>
                <dd>RGB colour monitor (default).</dd>

                <dt><code><b>composite</b></code></dt>
                <dd>
                    Composite colour monitor.
                </dd>

                <dt><code><b>mono</b></code></dt>
                <dd>Monochrome monitor.</dd>
            </dl>
            On
            <code><a href="#SCREEN-statement">SCREEN</a> 2</code> with
            <code><b><a href="#--video">--video</a>=</b>{<b>pcjr</b>|<b>tandy</b>|<b>cga</b>|<b>cga_old</b>}</code>,
            <code><b>--monitor=composite</b></code> enables (crude) colour artifacts.
        </dd>

        <dt id="--mono-tint">
            <code><b>--mono-tint=</b><var>r</var><b>,</b><var>g</var><b>,</b><var>b</var></code>
        </dt>
        <dd>
            Specify the monochrome tint as the red-green-blue values <code><var>r</var>,<var>g</var>,<var>b</var></code>, each in the range 0&#8212;255.
            Only has an effect if combined with <code><b><a href="#--monitor">--monitor</a>=mono</b></code>.
        </dd>

        <dt id="--mount">
            <code><b>--mount=</b><var>drive</var><b>:</b><var>path</var><b>,</b>[<var>drive</var><b>:</b><var>path</var> ... ]</code>
        </dt>
        <dd>
            Assign the path
            <code><var>path</var></code> to drive letter <code><var>drive</var>:</code>.
            The path can be absolute or relative. By
            default, <code>Z:</code> is assigned to the current working
            directory and no other drive letters are assigned.
        </dd>

        <dt id="-n">
            <code><b>-n</b></code>
        </dt>
        <dd>
            Run PC-BASIC as a command-line filter. Same as
            <code><b><a href="#--interface">--interface</a>=none</b></code>.
        </dd>

        <dt id="--nobox">
            <code><b>--nobox</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Disable box-drawing recognition for double-byte character set code pages. By
            default, sequences of box-drawing characters are recognised by an
            algorithm that isn't as smart as it thinks it is, and displayed as
            box drawing rather than as DBCS characters. If <code><b>--nobox</b></code>
            is set, they will be displayed as DBCS.
        </dd>

        <dt id="--nokill">
            <code><b>--nokill</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Allow BASIC to capture <kbd>Alt+F4</kbd>.
            Graphical interface only. By default,
            <kbd>Alt</kbd>+<kbd>F4</kbd> is captured by most operating
            systems as a quit signal, and will terminate PC-BASIC. Set
            <code><b>--nokill</b></code> to allow BASIC to capture
            <kbd>Alt</kbd>+<kbd>F4</kbd> instead. This is useful if
            your program uses this key combination.
        </dd>

        <dt id="--nosound">
            <code><b>--nosound</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Disable sound output.
        </dd>

        <dt id="--output">
            <code><b>--output=</b><var>output_file</var></code>
        </dt>
        <dd>
            Send screen output to <code><var>output_file</var></code>, except
            if <code>SCRN:</code> is written to explicitly. Output to
            <code>SCRN:</code> files will always be shown on the screen, as in
            GW-BASIC.
        </dd>

        <dt id="--pcjr-term">
            <code><b>--pcjr-term=</b><var>terminal_program</var></code>
        </dt>
        <dd>
            Set the terminal program run by the PCjr <code><a href="#TERM">TERM</a></code>
            command to <code><var>terminal_program</var></code>. This only has an
            effect with <code><b><a href="#--syntax">--syntax</a>=</b>{<b>pcjr</b>|<b>tandy</b>}</code>.
        </dd>

        <dt id="--peek">
            <code><b>--peek=</b>[<var>seg</var><b>:</b><var>addr</var><b>:</b><var>val</var>[<b>,</b><var>seg</var><b>:</b><var>addr</var><b>:</b><var>val</var> ... ]]</code>
        </dt>
        <dd>
            Define <code><a href="#PEEK">PEEK</a></code> preset values. If defined,
            <code>DEF SEG:? PEEK(<var>addr</var>)</code> will return
            <samp><var>val</var></samp>.
        </dd>

        <dt id="--pen">
            <code><b>--pen=</b>{<b>left</b>|<b>middle</b>|<b>right</b>|<b>none</b>}</code>
        </dt>
        <dd>
            Set the mouse button for light pen emulation. Default is <code><b>left</b></code>.
            If set to <code><b>none</b></code>, light pen emulation is switched off.
            On Android, <code><b>left</b></code> means touch input.
        </dd>

        <dt id="--preset">
            <code><b>--preset=</b><var>option_block</var></code>
        </dt>
        <dd>
            Load machine preset options. A preset option corresponds to a
            section defined in a config file by a name between square brackets,
            like <code class="block">[this]</code> <code><b>--preset=this</b></code> will load all
            settings defined in that section. Available presets depend on your
            configuration file. See the <a href="#presets">list of default presets</a> in the User's Guide.
        </dd>

        <dt id="--print-trigger">
            <code><b>--print-trigger=</b>{<b>line</b>|<b>page</b>|<b>close</b>}</code>
        </dt>
        <dd>
            Set the trigger to flush the print buffer to the printer.
            <dl class="compact">
                <dt><code><b>line</b></code>
                </dt><dd>The printer is activated after every line break.</dd>
                <dt><code><b>page</b></code>
                </dt><dd>The printer is activated after every page break.</dd>
                <dt><code><b>close</b></code>
                </dt><dd>The printer is activated only when PC-BASIC exits.</dd>
            </dl>
            Default is <code><b>close</b></code>.
        </dd>

        <dt id="--quit">
            <code id="-q"><b>-q</b></code>
            <code><b>--quit</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Quit interpreter when execution stops. If combined with
            <code><a href="#--run">--run</a></code>, PC-BASIC quits when the program
            ends. If set in interactive mode, PC-BASIC quits after the first
            command is executed.
        </dd>

        <dt id="--reserved-memory">
            <code><b>--reserved-memory=</b><var>number_of_bytes</var></code>
        </dt>
        <dd>
            Reserve <code><var>number_of_bytes</var></code> of memory at the
            bottom of the data segment. For compatibility with GW-BASIC.
            Default is <code>3429</code> bytes. Lowering this value makes more string and
            variable space available for use by programs.
        </dd>

        <dt id="--resume">
            <code><b>--resume</b>[<b>=True</b>|<b>=False</b></code>
        </dt>
        <dd>
            Resume from saved state. Overrides <code><a href="#--run">--run</a></code> and
            <code><a href="#--load">--load</a></code>.
        </dd>

        <dt id="--run">
            <code id="-r"><b>-r=</b><var>program</var></code>
            <code><b>--run=</b><var>program</var></code>
        </dt>
        <dd>
            Run the specified <code><var>program</var></code>. Overrides
            <code><a href="#--load">--load</a></code>.
        </dd>

        <dt id="--scaling">
            <code><b>--scaling=</b>{<b>smooth</b>|<b>crisp</b>|<b>native</b>}</code>
        </dt>
        <dd>
            Choose scaling method.
            <dl>
                <dt><code><b>smooth</b></code></dt>
                <dd>
                    The display is smoothly scaled to the largest size that allows for
                    the correct aspect ratio.
                </dd>

                <dt><code><b>crisp</b></code></dt>
                <dd>
                    The display is scaled to the same size as with <code><b>smooth</b></code>,
                    but without smoothing.
                </dd>

                <dt><code><b>native</b></code></dt>
                <dd>
                    Scaling and aspect ratio are optimised for the display's native
                    pixel size, without smoothing. <code><b>--scaling=native</b></code>
                    overrides <code><a href="#--aspect">--aspect.</a></code>
                </dd>
            </dl>
            Default is <code><b>smooth</b></code>.
            Only has an effect if combined with <code><b><a href="#--interface">--interface</a>=graphical</b></code>.
        </dd>

        <dt id="--serial-buffer-size">
            <code id="-c"><b>-c=</b><var>size</var></code>
            <code><b>--serial-buffer-size=</b><var>size</var></code>
        </dt>
        <dd>
            Set serial input buffer <code><var>size</var></code>. Default is
            <code>256</code>. If set to <code>0</code>, serial communications are disabled.
        </dd>

        <dt id="--shell">
            <code><b>--shell=</b>{<b>none</b>|<b>native</b>|<var>command</var>]</code>
        </dt>
        <dd>
            Set the command interpreter run on the <code><a href="#SHELL">SHELL</a></code>
            command to the operating system's native shell or a custom shell
            run by <code><var>command</var></code>. Default is <code><b>none</b></code>,
            which disables the <code><a href="#SHELL">SHELL</a></code> command.
        </dd>

        <dt id="--state">
            <code><b>--state=</b><var>state_file</var></code>
        </dt>
        <dd>
            Set the save-state file to <code><var>state_file</var></code>.
            Default is <code>PCBASIC.SAV</code> in the Application Data
            directory.
        </dd>

        <dt id="--strict-hidden-lines">
            <code><b>--strict-hidden-lines</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Disable listing and ASCII saving of lines beyond <code>65530</code>, as in
            GW-BASIC. Use with care as this allows execution of hidden
            lines of code.
        </dd>

        <dt id="--strict-newline">
            <code><b>--strict-newline</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Parse <code>CR</code> and <code>LF</code> in files strictly
            like GW-BASIC. On Unix, you will need to convert your files to DOS
            text first if using this option.
        </dd>

        <dt id="--strict-protect">
            <code><b>--strict-protect</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Disable listing and ASCII saving of protected files, as in
            GW-BASIC. Use with care as this allows execution of hidden
            lines of code.
        </dd>

        <dt id="--syntax">
            <code><b>--syntax=</b>{<b>advanced</b>|<b>pcjr</b>|<b>tandy</b>}</code>
        </dt>
        <dd>
            Choose BASIC dialect. Available dialects are:
            <dl class="compact">
                <dt><code><b>advanced</b></code></dt>
                <dd>Microsoft GW-BASIC and IBM BASICA</dd>

                <dt><code><b>pcjr</b></code></dt>
                <dd>IBM PCjr Cartridge BASIC</dd>

                <dt><code><b>tandy</b></code></dt>
                <dd>Tandy 1000 GW-BASIC.</dd>
            </dl>
            Default is <code><b>advanced</b></code>.
        </dd>

        <dt id="-t">
            <code><b>-t</b></code>
        </dt>
        <dd>
            Use text-based interface. Same as
            <code><b><a href="#--interface">--interface</a>=text</b></code>.
        </dd>

        <dt id="--text-width">
            <code><b>--text-width=</b>{<b>40</b>|<b>80</b>}</code>
        </dt>
        <dd>
            Set the number of columns in text mode at startup.
            Default is <code><b>80</b></code>.
        </dd>

        <dt id="--utf-8">
            <code><b>--utf8</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            Use UTF-8 for ASCII-mode programs. If <code><b>True</b></code>,
            programs stored as ASCII will be converted
            from UTF-8 on <code><a href="#LOAD">LOAD</a></code> and to UTF-8 on
            <code><a href="#SAVE">SAVE</a></code>.
        </dd>

        <dt id="--version">
            <code id="-v"><b>-v</b></code>
            <code><b>--version</b></code>
        </dt>
        <dd>
            Print PC-BASIC version string and exit.
        </dd>

        <dt id="--video">
            <code><b>--video=</b><var>card</var></code>
        </dt>
        <dd>
            Set the video card to emulate. Available video cards:
            <dl class="compact">
                <dt><code><b>vga</b></code></dt>
                <dd>Video Graphics Array</dd>

                <dt><code><b>ega</b></code></dt>
                <dd>Enhanced Graphics Adapter</dd>

                <dt><code><b>cga</b></code></dt>
                <dd>Color/Graphics Adapter</dd>

                <dt><code><b>cga_old</b></code></dt>
                <dd>Color/Graphics Adapter (old version; affects composite)</dd>

                <dt><code><b>mda</b></code></dt>
                <dd>Monochrome Display Adapter</dd>

                <dt><code><b>hercules</b></code></dt>
                <dd>Hercules Graphics Adapter</dd>

                <dt><code><b>pcjr</b></code></dt>
                <dd>IBM PCjr graphics</dd>

                <dt><code><b>tandy</b></code></dt>
                <dd>Tandy 1000 graphics</dd>

                <dt><code><b>olivetti</b></code></dt>
                <dd>Olivetti M24 graphics</dd>
            </dl>
            Default is <code><b>vga</b></code>.
        </dd>

        <dt id="--video-memory">
            <code><b>--video-memory=</b><var>size</var></code>
        </dt>
        <dd>
            Set the amount of emulated video memory available. This affects
            the number of video pages that can be used. On PCjr and Tandy, this
            can be changed at runtime through the
            <code><a href="#CLEAR">CLEAR</a></code> statement;
            at least 32768 needs to be available to enter
            <code><a href="#SCREEN-statement">SCREEN</a> 5</code> and <code>SCREEN 6</code>.
            Default is <code><b>16384</b></code> or PCjr and Tandy and <code><b>262144</b></code> on other
            <a href="#--preset">machine presets</a>.
        </dd>

        <dt id="--wait">
            <code id="-w"><b>-w</b></code>
            <code><b>--wait</b>[<b>=True</b>|<b>=False</b>]</code>
        </dt>
        <dd>
            If <code><b>True</b></code>, PC-BASIC waits for a keystroke before
            closing the window on exit. Only works for
            <code><b><a href="#--interface">--interface</a>=graphical</b></code> or
            <code><b>--interface=text</b></code>. Default is <code><b>False</b></code>.
        </dd>
    </dl>
</section>
<hr>
<!--
    PC-BASIC documentation
    Copyright (c) 2014-2015 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->

<section>
    <h3 id="examples">Examples</h3>
    <dl>
        <dt><code><b>pcbasic</b></code></dt>
        <dd>
            Start PC-BASIC in interactive mode, emulating GW-BASIC/BASICA
            with VGA graphics.
        </dd>

        <dt><code><b>pcbasic --codepage=950</b></code></dt>
        <dd>
            Start PC-BASIC using the Big-5 codepage.
        </dd>

        <dt><code><b>pcbasic Foobar.baz</b></code></dt>
        <dd>
            Start PC-BASIC with package Foobar. Load the settings from the
            package; usually this will run a main program contained in the
            package.
        </dd>

        <dt><code><b>pcbasic Foobar.baz --convert=A --utf8</b></code></dt>
        <dd>
            List the main program of package Foobar to standard output as
            UTF-8.
        </dd>

        <dt><code><b>pcbasic MYPROG.BAS --mount=A:./files,B:./morefiles</b></code></dt>
        <dd>
            Mount the current directory's subdirectory <code>files</code>
            as drive <code>A:</code> and subdirectory <code>morefiles</code> as
            drive <code>B:</code>, then run <code>MYPROG.BAS</code>.
        </dd>

        <dt><code><b>pcbasic --mount=A:C:\fakeflop</b></code></dt>
        <dd>
            Run PC-BASIC with Windows directory <code>C:\fakeflop</code> mounted as
            <code>A:</code> drive.
        </dd>

        <dt><code><b>pcbasic Z:\INFO.BAS --preset=mda --mono-tint=255,128,0</b></code></dt>
        <dd>
            Run <code>INFO.BAS</code> in the current directory on an
            emulated MDA with amber tinted monitor.
        </dd>

        <dt><code><b>pcbasic /home/me/retro/COMP.BAS --preset=cga --monitor=composite</b></code></dt>
        <dd>
            Run <code>COMP.BAS</code> stored at <code>/home/me/retro</code>
            on an emulated CGA machine with a composite monitor.
        </dd>

        <dt><code><b>pcbasic PCJRGAME.BAS --preset=pcjr -k='start\r'</b></code></dt>
        <dd>
            Run <code>PCJRGAME.BAS</code> on an emulated PCjr and feed in
            the keystrokes <kbd>s</kbd><kbd>t</kbd><kbd>a</kbd><kbd>r</kbd><kbd>t</kbd><kbd>Enter</kbd>.
        </dd>

        <dt><code><b>pcbasic BANNER.BAS --lpt2=PRINTER:</b></code></dt>
        <dd>
            Run <code>BANNER.BAS</code> in default mode with the default
            printer attached to <code>LPT2:</code>.
        </dd>

        <dt><code><b>pcbasic --resume</b></code></dt>
        <dd>
            Resume the most recently closed PC-BASIC session.
        </dd>

        <dt><code><b>pcbasic -qbe="?1+1"</b></code></dt>
        <dd>
            Execute the BASIC command <code>PRINT 1+1</code> in the
            command-line interface and return to the calling shell.
        </dd>
    </dl>
</section>
<hr>
</article>
<!--
    PC-BASIC documentation
    Copyright (c) 2014-2015 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->

<article>
<h2 id="reference">Language reference</h2>

<p>
    This documentation describes the PC-BASIC language. Since PC-BASIC emulates
    GW-BASIC 3.23, IBM Advanced BASIC, IBM Cartridge BASIC and Tandy 1000 GW-BASIC,
    it can also be used as documentation for those languages. Any differences
    between these original dialects and the PC-BASIC implementation are
    documented as well.
</p>
<p>
    Please note that the original Microsoft documentation, as found in various
    forms on the internet, is rather hit-and-miss;
    GW-BASIC often behaves differently than documented by Microsoft.
</p>

<section>
    <h3 id="metasyntax">Metasyntax</h3>
    <p>
        In descriptions of BASIC syntax, the following conventions apply.
        Exact rendering of the markup may vary depending on the means used
        to display this documentation.
    </p><p>
    </p><dl>
        <dt><code><b>bold</b></code></dt>
        <dd>Type exactly as shown.</dd>

        <dt><code><var>italic</var></code></dt>
        <dd>Replace with appropriate metavariable.</dd>

        <dt><code>[a]</code><dt>
        </dt></dt><dd>Entities within square brackets are optional.</dd>

        <dt><code>{ a | b }</code></dt>
        <dd>Disjunct alternatives of which one must be chosen.</dd>

        <dt><code>[ a | b ]</code></dt>
        <dd>Optional disjunct alternatives.</dd>

        <dt><code>a ...</code></dt>
        <dd>Preceding entity can be repeated.</dd>
    </dl>
    <p>
   </p>
</section>
<hr>

<section>
    <h3 id="literals">Literals</h3>

    <h5>String literals</h5>
    <p>
        String literals are of the following form:
        <code class="block"><b>"</b>[<var>characters</var>][<b><i>NUL</i></b>|<b><i>CR</i></b>|<b><i>EOF</i></b>|<b>"</b>]</code>
        where <code><var>characters</var></code> is a string of characters. Any
        character from the current code page can be used, with the following
        exceptions, all of which terminate the string literal (aside from other effects they may have):
    </p>
    <ul>
        <li><code><i>NUL</i></code> (<code>CHR$(0)</code>)</li>
        <li><code><i>CR</i></code> (<code>CHR$(13)</code>)</li>
        <li><code><i>EOF</i></code> (<code>CHR$(26)</code>)</li>
        <li><code>"</code> (<code>CHR$(34)</code>)</li>
    </ul>
    <p>
        Apart from these, string literals should not contain any of the characters
        in the ASCII range <code>&amp;H0D</code>&#8212;<code>&amp;H1F</code>, which lead to unpredictable results.
        There is no escaping mechanism. To include one of the above
        characters in a string, use <a href="#string-operators">string concatenation</a> and
        the <code><a href="#CHR%24">CHR$</a></code> function.
    </p>

    <h5>Numeric literals</h5>
    <p>
        Numeric literals have one of the following forms:
        <code class="block">[{<b>+</b>|<b>-</b>}] [<var>digits</var>] [<b>.</b>] [<var>digits</var>] [ { {<b>E</b>|<b>D</b>} [{<b>+</b>|<b>-</b>}] [<var>digits</var>] | <b>#</b> | <b>!</b> | <b>%</b> } ]</code>
        <code class="block"><b>&amp;</b>{<b>H</b>|<b>h</b>}<var>hexadecimal_digits</var></code>
        <code class="block"><b>&amp;</b>[<b>O</b>|<b>o</b>]<var>octal_digits</var></code>
        where <code><var>octal_digits</var></code> is a string of characters from <code><b>01234567</b></code>,
        <code><var>digits</var></code> is a string of characters from <code><b>0123456789</b></code>, and
        <code><var>hexadecimal_digits</var></code> is a case-insensitive string of characters from <code><b>0123456789ABCDEF</b></code>.
    </p>
    <p>
        Trailing <code>%</code> is ignored; trailing <code>!</code> or <code>#</code> <a href="#typechars">specify the type</a>.
    </p>
    <p>
        Examples of valid numeric literals are
        <code>-1</code> <code>42</code> <code>42!</code> <code>42#</code>
        <code>1.3523523</code> <code>.235435</code> <code>-.3</code> <code>3.</code>
        <code>.</code> <code>.e</code> <code>.D</code> <code>1.1e+7</code>
        <code>1.1d+7</code> <code>1e2</code> <code>1e-2</code> <code>&amp;7</code>
        <code>&amp;hffff</code> <code>&amp;O20</code>
    </p>

    <h5>Notes</h5>
    <ul>
        <li>
            Hexadecimal and octal literals are treated as unsigned integers. They must range between
            <code>-&amp;h7FFF</code> and <code>&amp;hFFFF</code>. <code>&amp;hFFFF = -&amp;h1 = &amp;h-1</code>.
        </li>
        <li>
            The <code>O</code> character in octal literals is optional. They can be
            specified equally as <code>&amp;o777</code> or <code>&amp;777</code>.
        </li>
    </ul>
</section>
<hr>

<section>
    <h3 id="variables">Variables</h3>
    <p>
        Variable names must start with a letter; all characters of the variable name
        (except the <a href="#typechars">type character</a>) must be letters <code>A&#8212;Z</code>, figures <code>0&#8212;9</code>, or a dot <code>.</code>
        Only the first 40 characters in the name are significant. Variable names must
        not be identical to <a href="#keywords">keywords</a>. Variable
        names may start with a keyword, with the exception of <code><a href="#USR">USR</a></code> and
        <code><a href="#FN">FN</a></code>. Thus, <code><a href="#FN">FN</a>ORD$</code>
        is not a legal variable name while <code><a href="#FRE">FRE</a>CKLE%</code> is.
    </p>
    <p>
        For each name, four different
        variables may exist corresponding to the four types. That is, you can have <code>A$</code>,
        <code>A%</code>, <code>A!</code> and <code>A#</code> as different variables.
        Which one of those is also known as <code>A</code> depends on the settings in
        <code><a href="#DEFINT">DEFINT</a></code>/<code>DEFDBL</code>/<code>DEFSNG</code>/<code>DEFSTR</code>.
        The default is <code> A = A!</code>. In addition, you can have
        <a href="#arrays">arrays</a> <code>A$()</code>, <code>A%()</code>,
        <code>A!()</code>, <code>A#()</code> which are separate from the scalar
        variables of the same name.
    </p>
</section>
<hr>

<section>
    <h3 id="arrays">Arrays</h3>
    <p>
        Arrays are groups of variables and can have the same <a href="#types">types</a> as <a href="#variables">variables</a>. Arrays are indexed with round or square
        brackets; even mixing brackets is allowed. The following all work: <code>A[0]</code>, <code>A(0)</code>,
        <code>A(0]</code>, <code>A[0)</code>. Multidimensional arrays are specified with commas: <code>A(0, 0)</code>, <code>A[0, 0, 0]</code>, etc.
    </p>
    <p>
        By default, arrays are indexed from <code>0</code>. This can be changed to
        <code>1</code> using <code><a href="#OPTION-BASE">OPTION BASE</a> 1</code>.
    </p>
    <p>
        Arrays can be allocated using <code><a href="#DIM">DIM</a></code>. If all indices of the array
        are <code>10</code> or less, they need not be explicitly allocated. The first
        access of the array (read or write) will automatically allocate it with
        a maximum index of <code>10</code> and the same number of indices as in the first
        access. To re-allocate an array, the old array must first be deleted
        with <code><a href="#CLEAR">CLEAR</a></code> or
        <code><a href="#ERASE">ERASE</a></code>.
    </p>
</section>
<hr>


<section>
    <h3 id="types">Types</h3>
    <h4 id="typechars">Type characters</h4>
    <p>
        PC-BASIC recognises four variable types, distinguished by their type character
        which is the last character of the variable's full name:
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>char</th>
                <th>type</th>
                <th>size</th>
            </tr><tr>
                <td><code>$</code></td>
                <td>string</td>
                <td>3 bytes plus allocated string space</td>
            </tr><tr>
                <td><code>%</code></td>
                <td>integer</td>
                <td>2 bytes </td>
            </tr><tr>
                <td><code>!</code></td>
                <td>single-precision float</td>
                <td>4 bytes</td>
            </tr><tr>
                <td><code>#</code></td>
                <td>double-precision float</td>
                <td>8 bytes</td>
            </tr>
        </table>
    </div>
    <p>
        If no type character is specified, the first letter of the name determines
        the type according to the settings of
        <code><a href="#DEFINT">DEFINT</a></code>/<code>DEFDBL</code>/<code>DEFSNG</code>/<code>DEFSTR</code>.
        If no such setting has been made, the default type is single-precision float.
    </p>

    <h4 id="limits">Machine limits</h4>
    <ul>
        <li>
            Line numbers are in <code>[0&#8212;65535]</code>, although line numbers <code>65530&#8212;65535</code> cannot be entered from the console.
        </li>
        <li>
            Integers are in <code>[-32768&#8212;32767]</code>. Negative integers are represented by the two's complement.
            Depending on context they may be interpreted as unsigned integers in the range <code>[0&#8212;65535]</code>.
        </li>
        <li>
            Floats: largest <code>1.701412E+38</code>; smallest <code>2.938726E-39</code>
        </li>
        <li>
            Double-precision floats can hold more decimals, but not larger or smaller numbers, than single-precision floats.
        </li>
    </ul>
</section>
<hr>

<section>
    <h3 id="operators">Operators</h3>

    <h4 id="order-of-preference">Order of precedence</h4>
    <p>
        The order of precedence of operators is as follows, from tightly bound
        (high priority) to loosely bound (low priority):
    </p>
    <ol>
        <li><code>^</code></li>
        <li><code>-</code> (unary)</li>
        <li><code>*</code></li>
        <li>
            <ul class="horizontal">
                <li><code>/</code></li>
                <li><code>\</code></li>
                <li><code>MOD</code></li>
            </ul>
        </li>
        <li>
            <ul class="horizontal">
                <li><code>+</code></li>
                <li><code>-</code> (binary)</li>
            </ul>
        </li>
        <li><code>=</code></li>
        <li>
            <ul class="horizontal">
                <li><code>&lt;&gt;</code></li>
                <li><code>&gt;&lt;</code></li>
                <li><code>&lt;</code></li>
                <li><code>&gt;</code></li>
                <li><code>&lt;=</code></li>
                <li><code>=&lt;</code></li>
                <li><code>&gt;=</code></li>
                <li><code>=&gt;</code></li>
            </ul>
        </li>
        <li><code>NOT</code></li>
        <li><code>AND</code></li>
        <li><code>OR</code></li>
        <li><code>XOR</code></li>
        <li><code>EQV</code></li>
        <li><code>IMP</code></li>
    </ol>
    <p>
        Note in particular that exponentiation is more tightly bound than negation:
        <code>-1^2 = -1</code> but <code>(-1)^2 = 1</code>.
    </p>

    <h4 id="math-operators">Mathematical operators</h4>
    <p>
        Mathematical operators operate on numeric expressions only. If either
        operand is a string, <samp>Type mismatch</samp> will be raised.
        Note however that <code>+</code> can take the role of the
        <a href="#string-operators">string concatenation operator</a>.
    </p>
    <div class="scrollable">
    <table>
        <tr>
            <th>Code</th>
            <th>Operation</th>
            <th>Result</th>
        </tr>
        <tr>
            <td id="^"><code><var>x</var> ^ <var>y</var></code></td>
            <td>Exponentiation</td>
            <td>
                <code><var>x</var></code> raised to the power of
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="unary-"><code>- <var>y</var></code></td>
            <td>Negation</td>
            <td>
                Negative value of <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="*"><code><var>x</var> * <var>y</var></code></td>
            <td>Multiplication</td>
            <td>
                Product of <code><var>x</var></code> and
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="/"><code><var>x</var> / <var>y</var></code></td>
            <td>Floating-point division</td>
            <td>
                Quotient of <code><var>x</var></code> and
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="\"><code><var>x</var> \ <var>y</var></code></td>
            <td>Integer division</td>
            <td>
                Integer part of quotient of <code><var>x</var></code> and
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="MOD"><code><var>x</var> MOD <var>y</var></code></td>
            <td>Integer modulo</td>
            <td>
                Remainder of the integer division of <code><var>x</var></code> by
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="+"><code><var>x</var> + <var>y</var></code></td>
            <td>Addition</td>
            <td>
                Sum of <code><var>x</var></code> and <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="-"><code><var>x</var> - <var>y</var></code></td>
            <td>Subtraction</td>
            <td>
                Difference of <code><var>x</var></code> and <code><var>y</var></code>
            </td>
        </tr>
    </table>
    </div>

    <h4 id="relational-operators">Relational operators</h4>
    <p>
        Relational operators can operate on numeric as well as string operands;
        however, if one operand is string and the other numeric, <samp>Type mismatch</samp>
        is raised.
    </p>
    <p>
        Relational operators return either <code>0</code> (for <i>false</i>) or
        <code>-1</code> for <i>true</i>.
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Result</th>
            </tr>
            <tr>
                <td id="="><code>=</code></td>
                <td>Equal</td>
                <td>
                    True if <code><var>a</var></code> equals <code><var>b</var></code>,
                    false otherwise.
                </td>
            </tr>
            <tr>
                <td id="&lt;&gt;"><code>&lt;&gt;</code> <code>&gt;&lt;</code></td>
                <td>Not equal</td>
            <td>
                False if <code><var>a</var></code> equals <code><var>b</var></code>,
                true otherwise.
            </td>
            </tr>
            <tr>
                <td id="&lt;"><code>&lt;</code></td>
                <td>Less than</td>
                <td>
                    True if <code><var>a</var></code> is less than <code><var>b</var></code>,
                    false otherwise.
                </td>
            </tr>
            <tr>
                <td id="&gt;"><code>&gt;</code></td>
                <td>Greater than</td>
                <td>
                    True if <code><var>a</var></code> is greater than <code><var>b</var></code>,
                    false otherwise.
                </td>
            </tr>
            <tr>
                <td id="&lt;="><code>&lt;=</code> <code>=&lt;</code></td>
                <td>Less than or equal</td>
                <td>
                    False if <code><var>a</var></code> is greater than <code><var>b</var></code>,
                    true otherwise.
                </td>
            </tr>
            <tr>
                <td id="&gt;="><code>&gt;=</code> <code>=&gt;</code></td>
                <td>Greater than or equal</td>
                <td>
                    False if <code><var>a</var></code> is less than <code><var>b</var></code>,
                    true otherwise.
                </td>
            </tr>
        </table>
    </div>
    <p>
        When operating on numeric operands, both operands are compared as floating-point
        numbers according to the usual ordering of numbers. The equals operator tests
        for equality to within machine precision for the highest-precision of the two
        operator types.
    </p>
    <p>
        When comparing strings, the ordering is as follows.
    </p>
    <ul>
        <li>
            Two strings are equal only if they are of the same length and every character
            code of the first string agrees with the corresponding character code of the
            second. This includes any whitespace or unprintable characters.
        </li>
        <li>
            Each character position of the strings is compared starting with the leftmost character.
            When a pair of different characters is encountered, the string
            with the character of lesser ASCII value is less than the string
            with the character of greater ASCII value.
        </li>
        <li>
            If the strings are of different length, but equal up to the length of the
            shorter string, then the shorter string is less than the longer string.
        </li>
    </ul>

    <h4 id="boolean-operators">Bitwise operators</h4>
    <p>
        PC-BASIC has no Boolean type and does not implement Boolean operators.
        It does, however, implement bitwise operators. Note that PC-BASIC represents
        negative integers using the two's complement.
    </p>
    <p>
        Bitwise operators operate on numeric expressions only. If either
        operand is a string, <samp>Type mismatch</samp> will be raised.
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Result</th>
            </tr>
            <tr>
                <td><code>NOT <var>y</var></code></td>
                <td>Complement</td>
                <td><code>-<var>y</var>-1</code></td>
            </tr>
            <tr>
                <td><code><var>x</var> AND y</code></td>
                <td>Bitwise conjunction</td>
                <td>
                    The bitwise AND of <code><var>x</var></code> and <code><var>y</var></code>
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> OR <var>y</var></code></td>
                <td>Bitwise disjunction</td>
                <td>
                    The bitwise OR of <code><var>x</var></code> and <code><var>y</var></code>
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> XOR <var>y</var></code></td>
                <td>Bitwise exclusive or</td>
                <td>
                    The bitwise XOR of <code><var>x</var></code> and <code><var>y</var></code>
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> EQV <var>y</var></code></td>
                <td>Bitwise equivalence</td>
                <td>
                    <code>NOT(<var>x</var> XOR <var>y</var>)</code>
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> IMP <var>y</var></code></td>
                <td>Bitwise implication</td>
                <td>
                    <code>NOT(<var>x</var>) OR <var>y</var></code>
                </td>
            </tr>
        </table>
    </div>
    <p>
        These operators can be used
        as Boolean operators only if <code>-1</code> is used to represent <i>true</i> while <code>0</code>
        represents <i>false</i>. This interpretation is given in the table below.
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Result</th>
            </tr>
            <tr>
                <td><code>NOT <var>y</var></code></td>
                <td>Logical negation</td>
                <td>True if <code><var>y</var></code> is false and vice versa</td>
            </tr>
            <tr>
                <td><code><var>x</var> AND y</code></td>
                <td>Conjunction</td>
                <td>
                    Only true if both  <code><var>x</var></code> and
                    <code><var>y</var></code> are true
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> OR <var>y</var></code></td>
                <td>Disjunction</td>
                <td>
                    Only false if both <code><var>x</var></code> and
                    <code><var>y</var></code> are false
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> XOR <var>y</var></code></td>
                <td>Exclusive or</td>
                <td>
                    True if the truth values of <code><var>x</var></code> and
                    <code><var>y</var></code> differ
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> EQV <var>y</var></code></td>
                <td>Equivalence</td>
                <td>
                    True if the truth values of <code><var>x</var></code> and
                    <code><var>y</var></code> are the same
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> IMP <var>y</var></code></td>
                <td>Implication</td>
                <td>
                    True if <code><var>x</var></code> is false or
                    <code><var>y</var></code> is true
                </td>
            </tr>
        </table>
    </div>
    <p>
        Be aware that when used on integers other than <code>0</code> and <code>-1</code>,
        bitwise operators can <em>not</em>
        be interpreted as Boolean operators. For example,
        <code>2 AND 1</code> returns <code>0</code>.
    </p>

    <h4 id="string-operators">String operators</h4>
    <p>There is one string operator, <code>+</code> for concatenation.</p>
    <div class="scrollable">
        <table>
            <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Result</th>
            </tr>
            <tr>
                <td><code><var>x</var> + <var>y</var></code></td>
                <td>Concatenation</td>
                <td>The string formed by <code><var>x</var></code> followed by <code><var>y</var></code></td>
            </tr>
        </table>
    </div>
</section>
<hr>

<section>
    <h3 id="statements-functions">Statements and functions</h3>

    <section>
        <h4 id="ABS"><code>ABS</code> function</h4>
        <code class="block">
            <var>y</var><b> = ABS(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the absolute value of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is an expression with a numeric value.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ASC"><code>ASC</code> function</h4>
        <code class="block">
            <var>val</var><b> = ASC(</b><var>char</var><b>)</b>
        </code>
        <p>
            Returns the ASCII code for the first character of <code><var>char</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>char</var></code> is an expression with
                a string value.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>char</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li><li>
                <code><var>char</var></code> equals <code>""</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ATN"><code>ATN</code> function</h4>
        <code class="block">
            <var>y</var><b> = ATN(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the inverse tangent of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a numeric expression that gives
                the angle in radians.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">double</a></code> option, this function
                returns a single-precision value.
            </li>
            <li>
                <code>ATN(x)</code> differs in the least significant digit from GW-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="AUTO"><code>AUTO</code> statement</h4>
        <code class="block">
            <b>AUTO</b> [<var>line_number</var>|<b>.</b>] [<b>,</b> [<var>increment</var>]]
        </code>
        <p>
            Start automatic line numbering. Line numbers
            are automatically generated when <kbd>Enter</kbd> is pressed.
            If a program line exists at a generated line number, a <code>*</code> is shown after the
            line number. To avoid overwriting this line, leave it empty and press <kbd>Enter</kbd>.
            To stop automatic line numbering, press <kbd>Ctrl</kbd>+<kbd>Break</kbd> or <kbd>Ctrl</kbd>+<kbd>C</kbd>. The line being edited at
            that point is not saved. BASIC will return to command mode, even if <code>AUTO</code> was
            run from a program line.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                Line numbering starts at <code><var>line_number</var></code>, if specified. If <code>.</code> is specified, line
                numbering starts at the last program line that was stored. Otherwise, line
                numbering starts at <code>10</code>.
            </li>
            <li>
                Each next line number is incremented by <code><var>increment</var></code>, if specified. If a comma
                is used without specifying an increment, the last increment specified in an
                <code>AUTO</code> command is used. If not, <code><var>increment</var></code> defaults to <code>10</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is not an unsigned-integer value in <code>[0&#8212;65529]</code>:
               <samp>Syntax error</samp>.
            </li>
            <li>
                When automatic line numbering is enabled and <kbd>Enter</kbd> is pressed on an empty line with number larger than
               <code>65519</code>: <samp>Undefined line number</samp>.
            </li>
            <li>
                <code><var>increment</var></code> is <code>0</code>:
                <samp>Illegal function call</samp>.
        </li></ul>
    </section>
<hr>

    <section>
        <h4 id="BEEP"><code>BEEP</code> statement</h4>
        <code class="block">
            <b>BEEP</b>
        </code>
        <p>
            Beep the speaker at 800Hz for 0.25s.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                If a <samp>Syntax error</samp> is raised, the beep is still produced.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="BEEP-switch"><code>BEEP</code> statement (switch)</h4>
        <code class="block">
            <b>BEEP</b> {<b>ON</b>|<b>OFF</b>}
        </code>
        <p>
            This statement has no effect.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Only legal with the <code><a href="syntax">syntax</a>={pcjr|tandy}</code> option.
            </li>
            <li>
                On PCjr and Tandy computers, <code>BEEP OFF</code> would turn off the internal speaker.
                On PC-BASIC, both the internal and the external speaker are emulated through
                the same sound system.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="BLOAD"><code>BLOAD</code> statement</h4>
        <code class="block">
            <b>BLOAD</b> <var>file_spec</var> [<b>,</b> <var>offset</var>]
        </code>
        <p>
            Loads a memory image file into memory.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is a string expression indicating
                the device and file to read the program from. See the <a href="#OPEN">OPEN</a>
                statement for valid file specifications. Refer to
                the section on <a href="#eightpointthree">file names on disk</a>
                for information on how this statement matches filenames on a disk
                device.
            </li>
            <li>
                <code><var>offset</var></code> is a numeric expression in the range <code>[-32768&#8212;65535]</code>.
                It indicates an offset in the current <code><a href="#DEF-SEG">DEF SEG</a></code> segment where the file is to be
                stored. If not specified, the offset stored in the <code><a href="BSAVE">BSAVE</a></code> file will be used. If
                negative, its two's complement will be used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The loaded file is not in <code>BSAVE</code> format: <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>offset</var></code> is not in the range <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="BSAVE"><code>BSAVE</code> statement</h4>
        <code class="block">
            <b>BSAVE</b> <var>file_spec</var><b>,</b> <var>offset</var><b>,</b> <var>length</var>
        </code>
        <p>
            Saves a region of memory to an image file.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is a string expression indicating
                the device and file to write from.
                See the <a href="#OPEN">OPEN</a> statement for valid file specifications.
                On disk devices, the file name will be converted to uppercase. If it
                is not an <a href="#eightpointthree">MS-DOS 8.3 filename</a>,
                additional characters will be clipped off and the name is converted to
                uppercase; if the filename contains no <code>.</code>, a default extension <code>.BAS</code> will
                be added. If the resulting file name already exists, it will be overwritten.
            </li>
            <li>
                <code><var>offset</var></code> is a numeric expression in the range <code>[-32768&#8212;65535]</code> indicating
                the offset into the current <code><a href="#DEF-SEG">DEF SEG</a></code> segment from where to start reading.
            </li>
            <li>
                <code><var>length</var></code> is a numeric expression in the range <code>[-32768&#8212;65535]</code> indicating
                the number of bytes to read.
            </li>
            <li>
                If <code><var>offset</var></code> or <code><var>length</var></code> are negative, their two's
                complement will be used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                <code><var>offset</var></code> is not in the range <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>length</var></code> is not in the range <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
    <h4 id="CALL"><code>CALL</code> statement</h4>
    <code class="block">
        <b>CALL</b> <var>address_var</var> [<b>(</b> <var>p0</var> [<b>,</b> <var>p1</var>] ... <b>)</b>]
    </code>
    <p>
        Does nothing.
    </p>
    <h5>Notes</h5>
    <ul>
        <li>
            In GW-BASIC, <code>CALL</code> executes a machine language subroutine.
        </li>
        <li>
            This statement is not implemented in PC-BASIC.
        </li>
    </ul>
    <h5>Parameters</h5>
    <ul>
        <li>
            <code><var>address_var</var></code> is a numeric variable.
        </li>
        <li>
            <code><var>p0</var>, <var>p1</var>, ...</code> are variables.
        </li>
    </ul>
    <h5>Errors</h5>
    <ul>
        <li>
            <code><var>address_var</var></code> is a string variable: <samp>Type mismatch</samp>.
        </li>
        <li>
            <code><var>address_var</var></code> is a literal: <samp>Syntax error</samp>.
        </li>
    </ul>
    </section>
<hr>

    <section>
        <h4 id="CALLS"><code>CALLS</code> statement</h4>
        <code class="block">
            <b>CALLS</b> <var>address_var</var> [<b>(</b> <var>p0</var> [<b>,</b> <var>p1</var>] ... <b>)</b>]
        </code>
        <p>Does nothing.</p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, <code>CALLS</code> executes a FORTRAN subroutine.
            </li>
            <li>
                This statement is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>address_var</var></code> is a numeric variable.
            </li>
            <li>
                <code><var>p0</var>, <var>p1</var>, ...</code> are variables.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>address_var</var></code> is a string variable: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>address_var</var></code> is a literal: <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CDBL"><code>CDBL</code> function</h4>
        <code class="block">
            <var>y</var><b> = CDBL(</b><var>x</var><b>)</b>
        </code>
        <p>
            Converts the numeric expression <code><var>x</var></code> to a double-precision value.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
    <h4 id="CHAIN"><code>CHAIN</code> statement</h4>
        <code class="block">
            <b>CHAIN</b> [<b>MERGE</b>] <var>file_spec</var> [<b>,</b> [<var>line_number_expr</var>] [<b>, ALL</b>] [<b>, DELETE</b> <var>range</var> [<b>,</b> <var>ign</var>]]]
        </code>
        <p>
            Loads a program from file into memory and runs it, optionally transferring variables.
        </p>
        <ul>
            <li>
                If <code>ALL</code> is specified, all variables are transferred. If not, the variables
                specified in a <code><a href="#COMMON">COMMON</a></code> statement are transferred.
            </li>
            <li>
                If <code>MERGE</code> is specified, the loaded program is merged into the existing program. To be
                able to use this, the program file indicated by <code><var>file_spec</var></code> must be in ASCII text format.
            </li>
            <li>
                If <code>DELETE</code> is specified, the <code><var>range</var></code> of line numbers is deleted from the
                existing code before the merge. This is pointless without <code>MERGE</code>.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is a string expression indicating
                the device and file to read the program from. See the <a href="#OPEN">OPEN</a>
                statement for valid file specifications. Refer to
                the section on <a href="#eightpointthree">file names on disk</a>
                for information on how this statement matches filenames on a disk
                device.
            </li>
            <li>
                <code><var>line_number_expr</var></code> is a numeric expression. It
                will be interpreted as a line number in the new program and execution will
                start from this line number. If <code><var>line_number_expr</var></code> is negative, it will be
                interpreted as its two's-complement.
            </li>
            <li>
                <code><var>range</var></code> is a line number range of which the closing line number is
                specified and exists before the merge.
            </li>
            <li>
                <code><var>ign</var></code> is optional and ignored.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>CHAIN</code> preserves the <code><a href="#OPTION-BASE">OPTION BASE</a></code> setting.
            </li>
            <li>
                <code>COMMON</code> variables remain <code>COMMON</code> for the next CHAIN.
            </li>
            <li>
                Only if <code>ALL</code> is specified, <code><a href="DEF-FN">DEF FN</a></code> definitions are preserved.
            </li>
            <li>
                Only if <code>MERGE</code> is specified, <code><a href="#DEFINT">DEFINT</a></code>, <code>DEFSTR</code>, <code>DEFSNG</code>, <code>DEFDBL</code> definitions
                are preserved.
            </li>
            <li>
                If specified, <code>ALL</code> must precede <code>DELETE</code>; if unspecified, no comma must
                be put in its place and only two commas should precede <code>DELETE</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                The file specified in <code><var>file_spec</var></code>
                cannot be found: <samp>File not found</samp>.
            </li>
            <li>
                <code>MERGE</code> is specified and the loaded program was not saved in ASCII mode:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                A line number in <code><var>range</var></code> is greater than 65529: <samp>Syntax error</samp>.
            </li>
            <li>
                If a <samp>Syntax error</samp> is raised by <code>CHAIN</code>, no lines are deleted and the new
                program is not loaded.
            </li>
            <li>
                The closing line number in <code><var>range</var></code> does not exist: <samp>Illegal function call</samp>
            </li>
            <li>
                If <code><var>line_number_expr</var></code> does not evaluate to an existing line number in the
                new program, <samp>Illegal function call</samp> is raised but the load or merge is
                being performed.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CHDIR"><code>CHDIR</code> statement</h4>
        <code class="block">
            <b>CHDIR</b> <var>pathname</var>
        </code>
        <p>
            Change the working directory on a disk device to <code><var>pathname</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>pathname</var></code> is a string expression indicating an
                absolute or relative path on a disk device.
                The device name may optionally be specified
                at the start of the expression (e.g. <code>"A:\"</code>. If the device
                name is omitted, the current directory on the current disk device is
                changed.
                Refer to the section on <a href="#eightpointthree">MS-DOS filenames</a>
                for information on how this statement matches file and directory names.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No matching path is found: <samp>Path not found</samp>.
            </li>
            <li>
                <code><var>pathname</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>pathname</var></code> is empty: <samp>Bad file name</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CHR$"><code>CHR$</code> function</h4>
        <code class="block">
            <var>char</var> <b>= CHR$(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the character with ASCII code <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a numeric expression in the range <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CINT"><code>CINT</code> function</h4>
        <code class="block">
            <var>y</var> <b>= CINT(</b><var>x</var><b>)</b>
        </code>
        <p>
            Converts the numeric expression <code><var>x</var></code> to a signed integer.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CIRCLE"><code>CIRCLE</code> statement</h4>
        <code class="block">
            <b>CIRCLE</b> [<b>STEP</b>] <b>(</b><var>x</var><b>,</b> <var>y</var>)<b>,</b> <var>radius</var>
            [<b>,</b> [<var>colour</var>] [<b>,</b> [<var>start</var>] [<b>,</b> [<var>end</var>] [<b>,</b> <var>aspect</var>]]]
        </code>
        <p>
            Draw an ellipse or ellipse sector.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The midpoint of the ellipse is at <code>(<var>x</var></code>,<code><var>y</var>)</code>.
                If <code>STEP</code> is specified, the midpoint is <code>(<var>x</var></code>,<code><var>y</var>)</code> away from the current position.
            </li>
            <li>
                <code><var>radius</var></code> is the radius, in pixels, along the long axis.
            </li>
            <li>
                <code><var>colour</var></code> is the colour attribute.
            </li>
            <li>
                If <code><var>start</var></code> and <code><var>end</var></code> are specified, a sector of the ellipse is drawn from
                <code><var>start</var></code> radians to <code><var>end</var></code> radians, with zero radians the intersection with the
                right-hand x axis. If a negative value is specified, the arc sector is
                connected by a line to the midpoint.
            </li>
            <li>
                <code><var>aspect</var></code> specifies the ratio between the y radius and the x radius. If it is
                not specified, the standard value for the <code><a href="#SCREEN-statement">SCREEN</a></code> mode is used (see there), so
                as to make the ellipse appear like a circle on the original hardware.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                For <code><var>aspect</var> &lt;&gt; 1</code>, the midpoint algorithm used does not pixel-perfectly
                reproduce GW-BASIC's ellipses.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The statement is executed in text mode: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>start</var></code> or <code><var>end</var></code> is not in <code>[0&#8212;2&#960;]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                The statement ends with a comma: <samp>Missing operand</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CLEAR"><code>CLEAR</code> statement</h4>
        <code class="block">
            <b>CLEAR</b> [<var>expr</var>] [<b>,</b> [<var>mem_limit</var>] [<b>,</b> [<var>stack_size</var>] [<b>,</b> <var>video_memory</var>]]]
        </code>
        <p>
            Clears all variables, arrays,<code><a href="#DEF-FN">DEF FN</a></code> user functions, <code><a href="#DEFINT">DEF<var>type</var></a></code> type definitions,
            and <code><a href="#COMMON">COMMON</a></code> declarations. Closes all files.
            Turns off all sound. Resets <code><a href="#PLAY">PLAY</a></code> state and sets music to foreground.
            Clears all <code><a href="#ON-ERROR">ON ERROR</a></code> traps. Resets <code><a href="#ERR">ERR</a></code> and <code><a href="#ERL">ERL</a></code> to zero. Disables all events.
            Turns <code><a href="#PEN-statement">PEN</a></code> and <code><a href="#STRIG-switch">STRIG</a></code> off. Resets the random number generator.
            Clears the loop stack. Resets the <code><a href="#DRAW">DRAW</a></code> state and the current graphics position.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mem_limit</var></code> specifies the upper limit of usable memory. Default is previous
                memory size. Default memory size is 65534.
            </li>
        <li>
        <code><var>stack_size</var></code> specifies the amount of memory available to the BASIC stack.
        Default is previous stack size. Default stack size is 512.
        </li>
            <li>
                <code><var>video_memory</var></code> specifies the amount of memory available
                to the video adapter. This parameter is only legal with one of the options
                <code><a href="#--syntax">--syntax</a>={pcjr, tandy}</code>. Instead of using
                <code>CLEAR</code>, the option <code><a href="#--video-memory">--video-memory</a></code>
                can also be used to set video memory size.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The purpose of <code><var>expr</var></code> is unknown.
            </li>
            <li>
                If called inside a <code><a href="#FOR">FOR</a></code>&#8212;<code><a href="#NEXT">NEXT</a></code> or <code><a href="#WHILE">WHILE</a></code>&#8212;<code><a href="#WEND">WEND</a></code> loop, an error will be raised at
                the iteration keyword as the loop stacks are cleared.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the arguments has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>mem_limit</var></code>, <code><var>stack_size</var></code> are not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>mem_limit</var></code> or <code><var>stack_size</var></code> equal <code>0</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>mem_limit</var></code> equals <code>-1</code> or <code>65535</code>: <samp>Out of memory</samp>.
            </li>
            <li>
                <code><var>mem_limit</var></code> or <code><var>expr</var></code> are too low: <samp>Out of memory</samp>.
            </li>
            <li>
                <code><var>expr</var></code> is not  in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>expr</var></code> is negative: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CLOSE"><code>CLOSE</code> statement</h4>
        <code class="block">
            <b>CLOSE</b> [[<b>#</b>] <var>file_0</var> [<b>,</b> [<b>#</b>] <var>file_1</var>] ...]
        </code>
        <p>
            Closes files. If no file numbers are specified, all open files are closed.
            The hash (<code>#</code>) is optional and has no effect.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_1</var>, <var>file_2</var>, ...</code> are numeric expressions yielding
                file numbers.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                No error is raised if the specified file numbers were not open.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_1</var>, <var>file_2</var>, ...</code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_1</var>, <var>file_2</var>, ...</code> are not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_1</var>, <var>file_2</var>, ...</code> have a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                The statement ends in a comma, <samp>Missing operand</samp>.
            </li>
            <li>
                If an error occurs, only the files before the erratic value are closed.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CLS"><code>CLS</code> statement</h4>
        <code class="block">
            <b>CLS</b> [<var>x</var>][<b>,</b>]
        </code>
        <p>
            Clears the screen or part of it.
            If <code><var>x</var></code> is not specified, in SCREEN 0 the text view region is cleared;
            in other screens, the graphics view region is cleared.
            The comma is optional and has no effect.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>x</var></code> is a numeric valued expression that determines what is cleared:
        </p>
        <ul>
            <li>
                If <code><var>x</var> = 0</code>, the whole screen is cleared.
            </li>
            <li>
                If <code><var>x</var> = 1</code>, the graphics view region is cleared.
            </li>
            <li>
                If <code><var>x</var> = 2</code>, the text view region is cleared.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> is has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp> .
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[0, 1, 2]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                No comma is specified but more text follows: <samp>Illegal function call</samp>.
            </li>
            <li>
                A comma is specified followed by more: <samp>Syntax error</samp>.
            </li>
            <li>
                If an error occurs, the screen is not cleared.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="COLOR"><code>COLOR</code> statement (text mode)</h4>
        <code class="block">
            <b>COLOR</b> [<var>foreground</var>] [<b>,</b> [<var>background</var>] [<b>,</b> <var>border</var>]]
        </code>
        <p>
            Changes the current foreground and background attributes.
            All new characters printed will take the newly set attributes. Existing
            characters on the screen are not affected.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>foreground</var></code> is a numeric expression in <code>[0&#8212;31]</code>.
                This specifies the new foreground attribute. Attributes <code>16&#8212;31</code> are
                blinking versions of attributes <code>0&#8212;15</code>.
            </li>
            <li>
                <code><var>background</var></code> is a numeric expression in <code>[0&#8212;15]</code>.
                This specifies the new background attribute. It is taken <code>MOD 8</code>: Values
                <code>8&#8212;15</code> produce the same colour as <code>0&#8212;7</code>.
            </li>
            <li>
                <code><var>border</var></code> is a numeric expression in <code>[0&#8212;15]</code> specifying the border attribute.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The syntax and effect of this command is different in different <code>SCREEN</code>
                modes. See below for other <code>SCREEN</code>s.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any of the parameters is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>foreground</var></code> is not in <code>[0&#8212;31]</code>, <code><var>background</var></code> is not in
                <code>[0&#8212;15]</code> or <code><var>border</var></code> is not in <code>[0&#8212;15]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                Statement is used in <code>SCREEN 2</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="COLOR-1"><code>COLOR</code> statement (<code>SCREEN 1</code>)</h4>
        <code class="block">
            <b>COLOR</b> [<var>palette_0</var>] [<b>,</b> <var>palette</var> [<b>,</b> <var>override</var>]]
        </code>
        <p>
            Assigns new colours to the palette of attributes.
        </p>
        <ul>
            <li>
                <code><var>palette_0</var></code> is a numeric expression  in <code>[0&#8212;255]</code>.
                This sets the palette colour associated with attribute 0; by default, the
                background has this attribute. All pixels with this attribute will
                change colour. The palette colour value is taken from the VGA 64-colour
                set. <code><var>palette_0</var></code> is taken <code>MOD 64</code>.
            </li>
            <li>
                <code><var>palette</var></code> is a numeric expression in <code>[0&#8212;255]</code> that specifies the palette:
                <ul>
                    <li>
                        <code><var>palette</var></code> odd sets the standard CGA palette (cyan, magenta, grey).
                    </li>
                    <li>
                        <code><var>palette</var></code> even sets the alternative palette (green, red, brown).
                    </li>
                </ul>
                All pixels with attributes 1,2,3 will change colour to the new palette.
            </li>
            <li>
                <code><var>override</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
                If <code><var>override</var></code> is specified, palette is set as above but using <code><var>override</var></code>
                instead of <code><var>palette</var></code>. <code><var>palette</var></code> is then ignored.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any of the parameters is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                Any of the parameters is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="COLOR-3-9"><code>COLOR</code> statement (<code>SCREEN 3&#8212;9</code>)</h4>
        <code class="block">
            <b>COLOR</b> [<var>foreground</var>] [<b>,</b> <var>palette_0</var> [<b>,</b> <var>dummy</var>]]
        </code>
        <p>
            Changes the current foreground attribute and the colour for attribute 0.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>foreground</var></code> is a numeric expression in <code>[0&#8212;15]</code>
                This sets the new foreground attribute. This applies only to new characters
                printed or pixels plotted.
            </li>
            <li>
                <code><var>palette_0</var></code> is a numeric expression in <code>[0&#8212;15]</code>
                This sets the colour associated with attribute 0; by default, the
                background has this attribute. All pixels with this attribute will
                change colour.
                In <code>SCREEN 7</code> and <code>8</code>, the <code><var>palette_0</var></code> colour is taken from the first 8 of
                the 16-colour EGA set. <code><var>palette_0</var></code> is taken <code>MOD 8</code>.
                IN <code>SCREEN 9</code>, the colour value is taken from the 64-colour VGA set.
            </li>
            <li>
                <code><var>dummy</var></code> is a numeric expression with a value in <code>[0&#8212;255]</code>
                The value of <code><var>dummy</var></code> is ignored.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any of the parameters is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>foreground</var></code> is not in <code>[1&#8212;15]</code>; <code><var>background</var></code> is not in <code>[0&#8212;15]</code>; or
                <code><var>dummy</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="COM"><code>COM</code> statement</h4>
        <code class="block">
            <b>COM(</b><var>port</var><b>)</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <ul>
            <li>
                <code>ON</code>: enables <code><a href="#ON-event">ON COM(<var>port</var>)</a></code> event trapping of the emulated serial port.
            </li>
            <li>
                <code>OFF</code>: disables trapping.
            </li>
            <li>
                <code>STOP</code>: halts trapping until <code>COM(<var>port</var>) ON</code> is used. Events that occur
                while trapping is halted will trigger immediately when trapping is re-enabled.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>port</var></code> is a numeric expression with a value of <code>1</code> or <code>2</code>. This specifies which
                serial port (<code>COM1:</code> or <code>COM2:</code>) is trapped.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="COMMON"><code>COMMON</code> statement</h4>
        <code class="block">
            <b>COMMON</b> [<var>var_0</var> [<b>,</b> [<var>var_1</var>]] ...]
        </code>
        <p>
            Specifies variables to be passed as common variables to the program called
            with <code><a href="#CHAIN">CHAIN</a></code>.
            The statement may end with one or more commas.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are names of variables or arrays. Array names
                must be followed by round or square brackets. Brackets may also be mixed <code>a(]</code> <code>b[)</code>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CONT"><code>CONT</code> statement</h4>
        <code class="block">
            <b>CONT</b> [<var>anything</var>]
        </code>
        <p>
            Resumes execution of a program that has been halted by
            <code><a href="#STOP">STOP</a></code>, <code><a href="#END">END</a></code>,
            <kbd>Ctrl</kbd>+<kbd>C</kbd>, or  <kbd>Ctrl</kbd>+<kbd>Break</kbd>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
            Anything after the <code>CONT</code> keyword is ignored.
            </li>
            <li>
                If a break is encountered in <code><a href="#GOSUB">GOSUB</a></code> routine called from a continuing
                direct line (e.g. <code>GOSUB 100:PRINT A$</code>), <code>CONT</code> will overwrite the running
                direct line. As the subroutine <code><a href="#RETURN">RETURN</a></code>s to the position after the <code>GOSUB</code> in
                the old direct line, strange things may happen if commands are given after
                <code>CONT</code>. In GW-BASIC, this can lead to strange errors in non-existing
                program lines as the parser executes bytes that are not part of a program
                line. In PC-BASIC, if the new direct line is shorter, execution stops
                after <code>RETURN</code>; but if the direct line is extended beyond the old return
                position, the parser tries to resume at that return position, with strange
                effects.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No program is loaded, a program has not been run, after a program line
                has been modified or after <code><a href="#CLEAR">CLEAR</a></code>: <samp>Can't continue</samp>.
            </li>
            <li>
                The break occurred in a direct line: <samp>Can't continue</samp>
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="COS"><code>COS</code> function</h4>
        <code class="block">
            <var>cosine</var> <b>= COS(</b><var>angle</var><b>)</b>
        </code>
        <p>
            Returns the cosine of <code><var>angle</var></code>.
            Unless PC-BASIC is run with the <code><a href="#--double">--double</a></code> option,
            this function returns a single-precision
            value.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>angle</var></code> is a numeric expression that
                gives the angle in radians.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The return value usually differs from the value returned by GW-BASIC in the least significant figure.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>angle</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CSNG"><code>CSNG</code> function</h4>
        <code class="block">
            <var>y</var> <b>= CSNG(</b><var>x</var><b>)</b>
        </code>
        <p>
            Converts the numeric expression <code><var>x</var></code> to a single-precision value.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CSRLIN"><code>CSRLIN</code> function</h4>
        <code class="block">
            <var>y</var> <b>= CSRLIN</b>
        </code>
        <p>
            Returns the screen row of the cursor on the active page.
            The return value is in the range <code>[1&#8212;25]</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This function has no brackets.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CVI"><code>CVI</code> function</h4>
        <code class="block">
            <var>y</var> <b>= CVI(</b><var>s</var><b>)</b>
        </code>
        <p>
            Converts a two-byte string to a signed integer.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>s</var></code> is a string expression that represents an integer using
                little-endian two's complement encoding. Only the first two bytes are used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>s</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CVS"><code>CVS</code> function</h4>
        <code class="block">
            <var>y</var> <b>= CVS(</b><var>s</var><b>)</b>
        </code>
        <p>
            Converts a four-byte string to a single-precision floating-point number.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>s</var></code> is a string expression that represents a single-precision
                number in Microsoft Binary Format. Only the first four bytes are used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>s</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="CVD"><code>CVD</code> function</h4>
        <code class="block">
            <var>y</var> <b>= CVD(</b><var>s</var><b>)</b>
        </code>
        <p>
            Converts an eight-byte string to a double-precision floating-point number.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>s</var></code> is a string expression  that represents a double-precision
                number in Microsoft Binary Format. Only the first eight bytes are used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>s</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DATA"><code>DATA</code> statement</h4>
        <code class="block">
            <b>DATA</b> [<var>const_0</var>] [<b>,</b> [<var>const_1</var>]] ...
        </code>
        <p>
            Specifies data that can be read by a READ statement.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>const_0</var>, <var>const_1</var>, ...</code>
                are string and number literals or may be empty. String literals can be given
                with or without quotation marks. If quotation marks are omitted, leading and
                trailing whitespace is ignored and commas or colons will terminate the data
                statement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                If the type of the literal does not match that of the corresponding <code><a href="#READ">READ</a></code>
                statement, a <samp>Syntax error</samp> occurs on the <code>DATA</code> statement.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DATE$"><code>DATE$</code> function</h4>
        <code class="block">
            <var>s</var> <b>= DATE$</b>
        </code>
        <p>
            Returns the system date as a string in the format <code>"mm-dd-yyyy"</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This function has no brackets.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DATE$-statement"><code>DATE$</code> statement</h4>
        <code class="block">
            <b>DATE$ = </b><var>date</var>
        </code>
        <p>
            Sets the system date. <code><var>date</var></code> is a string expression that represents a
            date in one of the formats: <code>"mm-dd-yyyy"</code>, <code>"mm/dd/yyyy"</code>, <code>"mm-dd-yy"</code>, <code>"mm/dd/yy"</code>.
        </p>
        <p>
            Of these,
        </p>
        <ul>
            <li>
                <code>mm</code> must be in <code>[01&#8212;12]</code>.
            </li>
            <li>
                <code>dd</code> must be in <code>[01&#8212;31]</code>.
            </li>
            <li>
                <code>yyyy</code> must be in <code>[1980&#8212;2099]</code>.
            </li>
            <li>
                <code>yy</code> must be in one of the ranges:
                <ul>
                    <li>
                        <code>[00&#8212;77]</code>, interpreted as <code>2000&#8212;2077</code>; or
                    </li>
                    <li>
                        <code>[80&#8212;99]</code>, interpreted as <code>1980&#8212;1999</code>.
                    </li>
                </ul>
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The system date is not actually changed; rather, PC-BASIC remembers the
                offset from the true system date. This avoids requiring user permission
                to change the system time.
            </li>
            <li>
                GW-BASIC appears to accept invalid dates such as <code>"02-31-2000"</code>. PC-BASIC
                raises <samp>Illegal function call</samp> for these.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>date</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>date</var></code> is not in the format specified above:
                <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DEF-FN"><code>DEF FN</code> statement</h4>
        <code class="block">
            <b>DEF FN</b>[ ]<var>name</var> [<b>(</b><var>arg_0</var> [<b>,</b> <var>arg_1</var>] ...<b>)</b>] <b>=</b> <var>expression</var>
        </code>
        <p>
            Defines a function called <code><a href="#FN">FN</a><var>name</var></code>
            (or <code>FN<var> name</var></code>: spaces between <code>FN</code> and <code><var>name</var></code> are optional).
            On calling <code>FN<var>name</var>( ... )</code>, <code><var>expression</var></code> is
            evaluated with the supplied parameters substituted. The result of the
            evaluation is the return value of <code>FN<var>name</var></code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This statement may only be used on a program line.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> must be a legal variable name.
            </li>
            <li>
                <code><var>arg_0</var>, <var>arg_1</var>, ...</code> must be legal variable names. These are the parameters of the
                function. Variables of the same name may or may not exist in the program; their value is not affected or used by the defined function.
            </li>
            <li>
                <code><var>expression</var></code> must be a legal PC-BASIC expression that may use the
                parameters <code><var>arg_0</var>, <var>arg_1</var>, ...</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The statement is executed directly instead of in a program line: <samp>Illegal direct</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DEFINT"><code>DEFINT</code>, <code>DEFDBL</code>, <code>DEFSNG</code>, <code>DEFSTR</code> statements</h4>
        <code class="block">
            <b>{DEFINT|DEFDBL|DEFSNG|DEFSTR}</b> <var>first_0</var>[<b>-</b> <var>last_0</var>] [<b>,</b> <var>first_1</var>[<b>-</b> <var>last_1</var>]] ...
        </code>
        <p>
            Sets the type that is assumed if no type character is specified when a variable name is used.
            The statement sets the default type for varables starting with a letter from the ranges specified.
        </p>
        <p>
            The default type is set to:
        </p>
        <dl class="compact">
            <dt><code>DEFINT</code></dt>
            <dd>integer (<code>%</code>)</dd>
            <dt><code>DEFDBL</code></dt>
            <dd>double (<code>#</code>)</dd>
            <dt><code>DEFSNG</code></dt>
            <dd>single (<code>!</code>)</dd>
            <dt><code>DEFSTR</code></dt>
            <dd>string (<code>$</code>)</dd>
        </dl>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>first_0</var>, <var>last_0</var>, ...</code> are letters of the alphabet.
                Pairs of letters connected by a dash <code>-</code> indicate includive ranges.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>DEFSNG A-Z</code> is the default setting.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DEF-SEG"><code>DEF SEG</code> statement</h4>
        <code class="block">
            <b>DEF SEG</b> [<b>=</b> <var>address</var>]
        </code>
        <p>
            Sets the memory segment to be used by <code><a href="#BLOAD">BLOAD</a></code>, <code><a href="#BSAVE">BSAVE</a></code>, <code><a href="#CALL">CALL</a></code>,
            <code><a href="#PEEK">PEEK</a></code>, <code><a href="#POKE">POKE</a></code>, or <code><a href="#USR">USR</a></code>.
            <code><var>address</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>address</var></code> is negative, it is interpreted as its two's complement.
            </li>
            <li>
                If <code><var>address</var></code> is not specified, the segment is set to the GW-BASIC data
                segment.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>address</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>address</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DEF-USR"><code>DEF USR</code> statement</h4>
        <code class="block">
            <b>DEF USR</b>[<var>n</var>] <b>=</b> <var>address</var>
        </code>
        <p>
            Does nothing.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>n</var></code> is a digit between 0 and 9 inclusive.
            </li>
            <li>
                <code><var>address</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, this statement sets the starting address of an assembly-language function.
            </li>
            <li>
                This statement is not implemented in PC-BASIC.
            </li>
            <li>
               If <code><var>address</var></code> is negative, it is interpreted as its two's complement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
            <code><var>n</var></code> is not a digit in <code>[0&#8212;9]</code>: <samp>Syntax error</samp>.
        </li>
        <li>
            <code><var>address</var></code> has a string value: <samp>Type mismatch</samp>.
        </li>
        <li>
            <code><var>address</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
        </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DELETE"><code>DELETE</code> statement</h4>
        <code class="block">
            <b>DELETE</b> [<var>line_number_0</var>|<b>.</b>] [<b>-</b>[<var>line_number_1</var>|<b>.</b>] ]
        </code>
        <p>
            Deletes a range of lines from the program.
            Also stops program execution and returns control to the user.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number_0</var></code> and
                <code><var>line_number_1</var></code> are line numbers in the range <code>[0&#8212;65529]</code>, specifying the inclusive range of line numbers to delete.
            </li>
            <li>
                A <code>.</code> indicates the last line edited.
            </li>
            <li>
                If the start point is omitted, the range will start at the start of the program.
            </li>
            <li>
                If the end point is omitted, the range will end at the end of the program.
            </li>
            <li>
                If no range is specified, the whole program will be deleted.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number_0</var></code> or
                <code><var>line_number_1</var></code> is greater than <code>65529</code>: <samp>Syntax error</samp>.
            </li>
            <li>
                The range specified does not include any program lines stored: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DIM"><code>DIM</code> statement</h4>
        <code class="block">
            <b>DIM</b> <var>name</var> {<b>(</b>|<b>[</b>} <var>limit_0</var> [<b>,</b> <var>limit_1</var>] ... {<b>)</b>|<b>]</b>}
        </code>
        <p>
            Allocates memory for arrays.
            The <code>DIM</code> statement also fixes the number of indices of the array.
            An array can only be allocated once; to re-allocate an array, <code><a href="#ERASE">ERASE</a></code> or
            <code><a href="#CLEAR">CLEAR</a></code> must be executed first.
            If an array is first used without a <code>DIM</code> statement, it is automatically allocated with its maximum indices set at <code>10</code>
            for each index position used. If an array's <code>DIM</code> statement specifies no indices,
            it is allocated with a single index with maximum <code>10</code>.
            The least index allowed is determined by <code><a href="#OPTION-BASE">OPTION BASE</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> is a legal variable name
                specifying the array to be allocated.
            </li>
            <li>
                <code><var>limit_0</var>, <var>limit_1</var>, ...</code> are numeric
                expressions that specify the greatest index allowed at that position.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Mixed brackets are allowed.
            </li>
            <li>
                The size of arrays is limited by the available BASIC memory.
            </li>
            <li>
                The maximum number of indices is, theoretically, <code>255</code>. In practice,
                it is limited by the 255-byte limit on the length of program lines.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>name</var></code> has already been dimensioned: <samp>Duplicate definition</samp>.
            </li>
            <li>
                An index is empty: <samp>Syntax error</samp>.
            </li>
            <li>
                An index is missing at the end: <samp>Missing operand</samp>.
            </li>
            <li>
                <code><var>limit_0</var>, <var>limit_1</var>, ...</code> have a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>limit_0</var>, <var>limit_1</var>, ...</code> are not within <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>limit_0</var>, <var>limit_1</var>, ...</code> are negative: <samp>Illegal function call</samp>.
            </li>
            <li>
                The array exceeds the size of available variable
                space: <samp>Out of memory</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="DRAW"><code>DRAW</code> statement</h4>
        <code class="block">
            <b>DRAW</b> <var>gml_string</var>
        </code>
        <p>
            Draws the shape specified by <code><var>gml_string</var></code>,
            a string expression in Graphics Macro Language (GML).
        </p>
        <h5>Graphics Macro Language reference</h5>
        <dl>
            <dt>Movement commands</dt>
            <dd>
                <code class="block">
                    [<b>B</b>][<b>N</b>] <var>movement</var>
                </code>
                where the default is to move and draw; the optional prefixes mean:
                <div class="scrollable">
                <table>
                    <tr>
                        <td><code><b>B</b></code></td>
                        <td>move but do not plot</td>
                    </tr><tr>
                        <td><code><b>N</b></code></td>
                        <td>return to original point after move</td>
                    </tr>
                </table>
                </div>
                and <code><var>movement</var></code> is one of:
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code><b>U</b>[<var>n</var>]</code></td>
                            <td>up <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>L</b>[<var>n</var>]</code></td>
                            <td>left <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>D</b>[<var>n</var>]</code></td>
                            <td>down <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>R</b>[<var>n</var>]</code></td>
                            <td>right <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>E</b>[<var>n</var>]</code></td>
                            <td>up and right <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>F</b>[<var>n</var>]</code></td>
                            <td>down and right <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>G</b>[<var>n</var>]</code></td>
                            <td>down and left <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>H</b>[<var>n</var>]</code></td>
                            <td>up and left <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>M</b>{<b>+</b>|<b>-</b>}<var>x</var><b>,</b>[<b>+</b>|<b>-</b>]<var>y</var></code></td>
                            <td>move (<code><var>x</var></code>,<code><var>y</var></code>) steps</td>
                        </tr><tr>
                            <td><code><b>M</b><var>x</var><b>,</b><var>y</var></code></td>
                            <td>move to view region coordinate (<code><var>x</var></code>,<code><var>y</var></code>)</td>
                        </tr>
                    </table>
                </div>
                <p>
                    where <code><var>n</var></code>, <code><var>x</var></code>, <code><var>y</var></code> are integers in <code>[0&#8212;9999]</code>.
                    Where optional, <code><var>n</var></code> defaults to <code>1</code>.
                </p>
            </dd>
            <dt>Scale commands</dt>
            <dd>
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code><b>S</b><var>n</var></code></td>
                            <td>
                                set the step size to <code><var>n</var>/4</code>. The default step size is 1 pixel.
                                <code><var>n</var></code> is an integer in <code>[1&#8212;255]</code>
                            </td>
                        </tr><tr>
                            <td><code><b>TA</b><var>n</var></code></td>
                            <td>
                                set the angle to <code><var>n</var></code> degrees. The default angle is 0 degrees.
                                <code><var>n</var></code> is an integer in <code>[-360&#8212;360]</code>
                            </td>
                        </tr>
                        <tr>
                            <td><code><b>A</b><var>n</var></code></td>
                            <td>
                                set the angle to
                                0 for <code><var>n</var>=0</code>,
                                90 for <code><var>n</var>=1</code>,
                                180 for <code><var>n</var>=2</code>,
                                270 for <code><var>n</var>=3</code>.
                                <code><var>n</var></code> is an integer in <code>[0&#8212;3]</code>
                            </td>
                        </tr>
                    </table>
                </div>
            </dd>
            <dt>Colour commands</dt>
            <dd>
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code><b>C</b><var>n</var></code></td>
                            <td>
                                set the foreground attribute to <code><var>n</var></code>.
                                See <code><a href="#COLOR">COLOR</a></code>.
                            </td>
                        </tr>
                        <tr>
                            <td><code><b>P</b><var>n</var>,<var>b</var></code></td>
                            <td>
                                flood fill with attribute <code><var>n</var></code> and boundary
                                attribute <code><var>b</var></code>.
                                See <code><a href="#PAINT">PAINT</a></code>.
                            </td>
                        </tr>
                    </table>
                </div>
            </dd>
            <dt>Subroutine command</dt>
            <dd>
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code><b>X</b><var>s</var></code></td>
                            <td>execute a substring</td>
                        </tr>
                    </table>
                </div>
                <p><code><var>s</var></code> is one of the following:</p>
                <ul>
                    <li>a string variable name followed by semicolon (<code>;</code>)</li>
                    <li>the result of <code><a href="#VARPTR%24">VARPTR$()</a></code> on a string variable</li>
                </ul>
            </dd>
        </dl>
        <p>
            Numeric variables <code><var>n</var></code>, <code><var>x</var></code>,
            <code><var>y</var></code>, <code><var>b</var></code> in the commands above can be:
        </p>
        <ul>
            <li>
                an integer literal, e.g. <code>DRAW "U100"</code>
            </li>
            <li>
                a numeric variable name <code><var>var</var></code> preceded by <code>=</code> and followed by <code>;</code> e.g. <code>DRAW "U=VAR;"</code>
            </li>
            <li>
                the result of <code>VARPTR$(<var>var</var>)</code> preceded by <code>=</code>.  For example, <code>DRAW "U=" + VARPTR$(VAR)</code>
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The <code>CLS</code> statement resets the step size to 1 pixel, angle to 0 degrees and position to the
                centre of the view region.
            </li>
            <li>
                The value <code><var>n</var></code> in the <code>TA</code>, <code>A</code> and <code>C</code> command can be left out but <em>only</em> if the
                command is terminated by a semicolon. <code><var>n</var></code> defaults to <code>0</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>gml_string</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>gml_string</var></code> has errors in the GML: <samp>Illegal function call</samp>.
            </li>
            <li>
                A variable referenced in the GML string is of incorrect type: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="EDIT"><code>EDIT</code> statement</h4>
        <code class="block">
            <b>EDIT</b> {<var>line_number</var>|<b>.</b>}
        </code>
        <p>
            Displays the specified program line with the cursor positioned for editing.
            <code><var>line_number</var></code> must be a line that exists in the program, or a period (.) to
            indicate the last line stored.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                No line_number is specified: <samp>Undefined line number</samp>.
            </li>
            <li>
                More characters are written after the line number: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>line_number</var></code> is not in <code>[0&#8212;65529]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                The specified line number does not exist: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ELSE"><code>ELSE</code> statement</h4>
        <code class="block">
            <b>ELSE</b> [<var>anything</var>]
        </code>
        <p>
            Unless part of an <code><a href="#IF">IF</a></code> statement on the same line, anything after <code>ELSE</code> is ignored
            in the same way as after <code>'</code> or <code>:<a href="#REM">REM</a></code>. No colon <code>:</code> preceding
            the <code>ELSE</code> statement is necessary. See <code><a href="#IF">IF</a></code> for normal usage.
        </p>
    </section>
<hr>

    <section>
        <h4 id="END"><code>END</code> statement</h4>
        <code class="block">
            <b>END</b>
        </code>
        <p>
            Closes all files, stops program execution and returns control to the user.
            No message is printed. It is possible to resume execution at the next statement
            using <code><a href="#CONT">CONT</a></code>.
        </p>
    </section>
<hr>

    <section>
        <h4 id="ENVIRON"><code>ENVIRON</code> statement</h4>
        <code class="block">
            <b>ENVIRON</b> <var>command_string</var>
        </code>
        <p>
            Sets a shell environment variable.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>command_string</var></code> is a string expression of one of the following forms:
        </p>
        <dl>
            <dt>
                <code class="block">
                    <b>"</b><var>VARIABLE</var><b>=</b><var>VALUE</var><b>"</b>
                </code>
            </dt>
            <dd>
                to set <code><var>VARIABLE</var></code> to <code><var>VALUE</var></code>;
            </dd>
            <dt>
                <code class="block">
                    <b>"</b><var>VARIABLE</var><b>="</b>
                </code>
            </dt>
            <dd>
                to unset <code><var>VARIABLE</var></code>.
            </dd>
        </dl>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>command_string</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>command_string</var></code> is not of the required form: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ENVIRON$"><code>ENVIRON$</code> function</h4>
        <code class="block">
            <var>value</var> <b>= ENVIRON</b>[ ]<b>$</b>(<var>x</var>)
        </code>
        <p>
            Returns an environment variable.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>x</var></code> is an expression.
        </p>
        <ul>
            <li>
                If <code><var>x</var></code> has a string value, returns the value for the environment variable <code><var>x</var></code> or the empty
                string if no variable with the name <code><var>x</var></code> is set in the environment table.
            </li>
            <li>
                If <code><var>x</var></code> has a numeric value, it must be in <code>[1&#8212;255]</code>. Returns the <code><var>x</var></code>th entry in
                the environment table.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> is the empty string: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>x</var></code> is a number not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x</var></code> is a number not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="EOF"><code>EOF</code> function</h4>
        <code class="block">
            <var>is_at_end</var> <b>= EOF(</b><var>file_num</var><b>)</b>
        </code>
        <p>
            Returns -1 if file with number <code><var>file_num</var></code> has reached end-of-file; 0 otherwise.
            The file must be open in <code>INPUT</code> or <code>RANDOM</code> mode. <code>EOF(0)</code> returns 0.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>file_num</var></code> is open to <code>KYBD:</code>, performs a blocking read and returns -1 if
                <kbd>CTRL</kbd>+<kbd>Z</kbd> is entered, 0 otherwise. The character entered is then echoed to
                the console.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is a number not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is a number not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not 0 or the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                The file with number <code><var>file_num</var></code> is in OUTPUT or APPEND mode:
                <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ERASE"><code>ERASE</code> statement</h4>
        <code class="block">
            <b>ERASE</b> <var>array_0</var> [<b>,</b> <var>array_1</var>] ...
        </code>
        <p>
            De-allocates arrays. The data stored in the
            arrays is lost.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>array_0</var>, <var>array_1</var> ...</code> are names of existing arrays. The names must be
                specified without brackets.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No array names are given: <samp>Syntax error</samp>.
            </li>
            <li>
                <code><var>array_0</var>, <var>array_1</var> ...</code> do not exist: <samp>Illegal function call</samp>.
            </li>
            <li>
                If an error occurs, the arrays named before the error occurred are erased.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ERDEV"><code>ERDEV</code> function</h4>
        <code class="block">
            <var>zero</var> <b>= ERDEV</b>
        </code>
        <p>
            Returns 0.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, returns the value of a device error.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
            <li>
                This function has no brackets.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ERDEV$"><code>ERDEV$</code> function</h4>
        <code class="block">
            <var>empty</var> <b>= ERDEV</b>[ ]<b>$</b>
        </code>
        <p>
            Returns the empty string.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, returns the device name of a device error.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
            <li>
                This function has no brackets.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ERL"><code>ERL</code> function</h4>
        <code class="block">
            <var>error_line</var> <b>= ERL</b>
        </code>
        <p>
            Returns the line number where the last error was raised.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                If the error was
                raised by a direct statement, returns 65535.
            </li>
            <li>
                If no error has been raised,
                returns 0.
            </li>
            <li>
                This function has no brackets.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ERR"><code>ERR</code> function</h4>
        <code class="block">
            <var>error_code</var> <b>= ERR</b>
        </code>
        <p>
            Returns the number of the last error.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                If no error has been raised, returns 0.
            </li>
            <li>
               If the last error was a <samp>Syntax error</samp> raised by a direct statement, returns 0.
            </li>
            <li>
                This function has no brackets.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ERROR"><code>ERROR</code> statement</h4>
        <code class="block">
            <b>ERROR</b> <var>error_number</var>
        </code>
        <p>
            Raises the error with number <code><var>error_number</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>error_number</var></code> is an expression
                with a numeric value.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>error_number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>error_number</var></code> is not in  <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>error_number</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="EXP"><code>EXP</code> function</h4>
        <code class="block">
            <var>y</var> <b>= EXP(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the exponential of <code><var>x</var></code>, i.e. <code>e</code> to the power <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a number-
                valued expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">--double</a></code> option, this function returns a single-precision
                value.
            </li>
            <li>
                The return value sometimes differs in the least significant digit from GW-BASIC. For
                large values of <code><var>x</var></code>, the difference may be 3 digits.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is larger than the natural logarithm of the maximum single-precision
                value: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="EXTERR"><code>EXTERR</code> function</h4>
        <code class="block">
            <var>zero</var> <b>= EXTERR(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns 0.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, this function returns extended error information from MS-DOS.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="FIELD"><code>FIELD</code> statement</h4>
        <code class="block">
            <b>FIELD</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>width_0</var> <b>AS</b> <var>name_0</var> [<b>,</b> <var>width_1</var> <b>AS</b> <var>name_1</var>] ...]
        </code>
        <p>
            Assigns variables to the random-access record buffer. The record buffer is a
            region of memory of length defined by the <code><a href="#OPEN">OPEN</a></code> statement; the default record
            length is 128 bytes. The <code><a href="#FIELD">FIELD</a></code> statement assigns a portion of this region to
            one or more fixed-length string variables, so that the value of these strings
            is whatever happens to be in the record buffer at that location.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                A <code>FIELD</code> statement
                without any variables specified has no effect.
            </li>
            <li>
                Another  <code>FIELD</code> statement on the same file will specify an alternative mapping of the
                same file buffer; all mappings will be in effect simultaneously.
            </li>
            <li>
                A subsequent assignment or <code><a href="#LET">LET</a></code> or <code><a href="#MID%24">MID$</a></code> statement on <code><var>name_0</var> , <var>name_1</var> ...</code> will dis-
                associate the string variable from the field buffer.
            </li>
            <li>
                Use <code><a href="#LSET">LSET</a></code> or <code><a href="#RSET">RSET</a></code> to change
                values in the field buffer.
            </li>
            <li>
                Use <code><a href="#GET-files">GET</a></code> to read values from the file into the field
                buffer, changing the variables.
            </li>
            <li>
                Use <code><a href="#PUT-files">PUT</a></code> to write the field buffer to the file.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression that yields the number of an open random-access file. The <code>#</code> is optional and has no effect.
            </li>
            <li>
                <code><var>width_0</var>, <var>width_1</var>, ...</code> are numeric
                expressions giving the length of the string variables
            </li>
            <li>
                <code><var>name_0</var> , <var>name_1</var> ...</code> are string variables.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is open under a mode other than <code>RANDOM</code>:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                The statement ends in a comma: <samp>Missing operand</samp>.
            </li>
            <li>
                No file number is specified: <samp>Missing operand</samp>.
            </li>
            <li>
                The lengths in a <code><a href="#FIELD">FIELD</a></code> statement add up to a number larger than the
                record length of the field buffer: <samp>Field overflow</samp>.
            </li>
            <li>
                <code><var>name_0</var> , <var>name_1</var> ...</code> specify a non-string variable: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="FILES"><code>FILES</code> statement</h4>
        <code class="block">
            <b>FILES</b> [<var>path_and_filter</var>]
        </code>
        <p>
            Displays the files fitting the specified filter in the specified directory on a disk device. If
            <code><var>path_and_filter</var></code> is not specified, displays all files in the current working
            directory.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>path_and_filter</var></code> is a string expression that
                consists of two optional parts: the first part is the path to the directory;
                the second part is the filename filter.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The filename filter consists of file name
                parts and the following wildcards:
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code>?</code></td>
                            <td>matches any character but not the <code>\</code> or <code>.</code></td>
                        </tr>
                        <tr>
                            <td><code>*</code></td>
                            <td>matches any series of characters excluding <code>\</code> or <code>.</code></td>
                        </tr>
                    </table>
                </div>
            </li>
            <li>
                A filter
                will only match <a href="#eightpointthree">MS-DOS style filenames</a>.
                The directory names in the path, however, can be case sensitive
                and longer if the host OS supports this.
            </li>
            <li>
                If all files in a
                specified directory are required, end the directory name with a backslash <code>\</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>path_and_filter</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>path_and_filter</var></code> is the empty string: <samp>Bad file name</samp>.
            </li>
            <li>
                The specified filter does not match any files: <samp>File not found</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="FIX"><code>FIX</code> function</h4>
        <code class="block">
            <var>whole</var> <b>= FIX(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns <code><var>number</var></code> truncated towards zero.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>FIX</code> truncates towards zero: it removes the fractional part. By contrast, <code><a href="#INT">INT</a></code>
                truncates towards negative infinity. For negative <code><var>x</var></code>, <code>FIX(<var>x</var>)-INT(<var>x</var>)=1</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a string expression: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="FN"><code>FN</code> function</h4>
        <code class="block">
            <var>result</var> <b>= FN</b>[ ]<var>name</var> [<b>(</b><var>arg_0</var> [<b>,</b> <var>arg_1</var>] ...<b>)</b>]F
        </code>
        <p>
            Evaluates the user-defined function previously defined with <code><a href="#DEF-FN">DEF FN</a> <var>name</var></code>.
            Spaces between <code>FN</code> and <code><var>name</var></code> are optional.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> is the name of a previously defined function.
            </li>
            <li>
                <code><var>arg_0</var>, <var>arg_1</var>, ...</code> are expressions, given as parameters to the function.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No function named <code><var>name</var></code> is defined:
                <samp>Undefined user function</samp>.
            </li>
            <li>
                The number of parameters differs from the function definition:
                <samp>Syntax error</samp>.
            </li>
            <li>
                The type of one or more parameters differs from the function definition:
                <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="FOR"><code>FOR</code> statement</h4>
        <code class="block">
            <b>FOR</b> <var>loop_var</var> <b>=</b> <var>start</var> <b>TO</b> <var>stop</var> [<b>STEP</b> <var>step</var>]
        </code>
        <p>
            Initiates a <code>FOR&#8212;NEXT</code> loop.
        </p>
        <p>
            Initially, <code><var>loop_var</var></code> is set to <code><var>start</var></code>. Then, the statements between the <code>FOR</code>
            statement and the <code><a href="#NEXT">NEXT</a></code> statement are executed and <code><var>loop_var</var></code> is incremented by
            <code><var>step</var></code> (if <code><var>step</var></code> is not specified, by 1). This is repeated until <code><var>loop_var</var></code>
            has become greater than <code><var>stop</var></code>. Execution then continues at the statement
            following <code>NEXT</code>. The value of <code><var>loop_var</var></code> equals <code><var>stop</var>+<var>step</var></code> after the loop.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>loop_var</var></code> is a numeric variable.
            </li>
            <li>
                <code><var>start</var></code>, <code><var>stop</var></code> and <code><var>step</var></code> are numeric expressions.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No <code>NEXT</code> statement is found to match the <code>FOR</code>
                statement: <samp>FOR without NEXT</samp> occurs at the <code>FOR</code>
                statement.
            </li>
            <li>
                <code><var>loop_var</var></code> is a string variable or <code><var>start</var></code>,
                <code><var>stop</var></code>, or <code><var>end</var></code> has a string value:
                <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>loop_var</var></code> is an array element: <samp>Syntax error</samp> .
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="FRE"><code>FRE</code> function</h4>
        <code class="block">
            <var>free_mem</var> <b>= FRE(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the available BASIC memory.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>x</var></code> is an expression.
        </p>
        <ul>
            <li>
                If <code><var>x</var></code> has a numeric value, it is ignored.
            </li>
            <li>
                If <code><var>x</var></code> has a string value, garbage collection is performed
                before returning available memory.
        </li></ul>
    </section>
<hr>

    <section>
        <h4 id="GET-files"><code>GET</code> statement (files)</h4>
        <code class="block">
            <b>GET</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>record_number</var>]
        </code>
        <p>
            Read a record from the random-access file <code><var>file_number</var></code> at position
            <code><var>record_number</var></code>.
            The record can be accessed through the <code><a href="#FIELD">FIELD</a></code>
            variables or through <code><a href="#INPUT%24">INPUT$</a></code>,
            <code><a href="#INPUT">INPUT</a></code> or
            <code><a href="#LINE-INPUT">LINE INPUT</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression that yields the number
                of an open random-access file. The <code>#</code> is optional and has no effect.
            </li>
            <li>
                <code><var>record_number</var></code> is a numeric expression in <code>[1&#8212;33554432]</code> (<code>2^25</code>), and is interpreted as the record number.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If the record number is beyond the end of the file, the file buffer is
                filled with null bytes.
            </li>
        </ul>
            <h5>Errors</h5>
        <ul>
            <li>
                <code><var>record_number</var></code> is not in <code>[1&#8212;33554432]</code>: <samp>Bad record number</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is open under a mode other than <code>RANDOM</code>:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not specified: <samp>Missing operand</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="GET-serial"><code>GET</code> statement (communications)</h4>
        <code class="block">
            <b>GET</b> [<b>#</b>] <var>com_file_number</var> [<b>,</b> <var>number_bytes</var>]
        </code>
        <p>
            Read <code><var>number_bytes</var></code> bytes from the communications buffer opened under file
            number <code><var>com_file_number</var></code>.
            The record can be accessed through the <code><a href="#FIELD">FIELD</a></code>
            variables or through <code><a href="#INPUT%24">INPUT$</a></code>,
            <code><a href="#INPUT">INPUT</a></code> or
            <code><a href="#LINE-INPUT">LINE INPUT</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression that yields the number
                of a file open to a <code>COM</code> device. The <code>#</code> is optional and has no effect.
            </li>
            <li>
                <code><var>number_bytes</var></code> is a numeric expression between <code>1</code>
                and the <code>COM</code> buffer length, inclusive.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>bytes</var></code> is <code>32768</code> or greater, GW-BASIC hangs. This functionality is not implemented in PC-BASIC.
            </li>
            <li>
                In GW-BASIC, <samp>Device I/O error</samp> is raised for overrun error, framing error,
                and break interrupt. <samp>Device fault</samp> is raised if DSR is lost during I/O.
                <samp>Parity error</samp> is raised if parity is enabled and incorrect parity is
                encountered. This is according to the manual; it is untested.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>bytes</var></code> is less than 1: <samp>Bad record number</samp>
            </li>
            <li>
                <code><var>bytes</var></code> is less than <code>32768</code> and greater than the <code>COM</code> buffer length: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not specified: <samp>Missing operand</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                If the serial input buffer is full, i.e. <code><a href="#LOF">LOF</a>(<var>com_file_number</var>) = 0</code>, and
                <code><a href="#LOC">LOC</a>(<var>com_file_number</var>) = 255</code>: <samp>Communication buffer overflow</samp>
            </li>
            <li>
                If the carrier drops during <code>GET</code>, hangs until the <kbd>Ctrl</kbd>+<kbd>Break</kbd> key is pressed.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="GET-graphics"><code>GET</code> statement (graphics)</h4>
        <code class="block">
            <b>GET (</b><var>x0</var><b>,</b> <var>y0</var><b>) -</b> [<b>STEP</b>] <b>(</b><var>x1</var><b>,</b> <var>y1</var><b>),</b> <var>array_name</var>
        </code>
        <p>
            Stores a rectangular area of the graphics screen in an array.
            The area stored is a rectangle parallel to the screen edges, bounded by the
            top-left and bottom-right coordinates <code><var>x0</var></code>,<code><var>y0</var></code> and <code><var>x1</var></code>,<code><var>y1</var></code>. If <code>STEP</code> is
            specified, <code><var>x1</var></code>,<code><var>y1</var></code> is an offset from <code><var>x0</var></code>,<code><var>y0</var></code>. The area is such that these
            corner points are inside it.
        </p>
        <p>
            The image stored in the array can then be put on the screen using PUT. For the
            purposes of <code>GET</code>, any array is considered a string of bytes. The byte size of an
            array can be calculated as <code><var>number_elements</var> * <var>byte_size</var></code> with <code><var>byte_size</var></code> equal to
            <code>2</code> for integers (<code>%</code>), 4 for single (<code>!</code>) and 8 for double (<code>#</code>).
            Array byte size for
            string is 3, but string arrays are not allowed in <code>GET</code>. For calculating the
            number of elements, keep in mind that <code><a href="#OPTION-BASE">OPTION BASE</a> 0</code> is the default; in which
            case an array with maximum index 10 has 11 elements. This works through in
            multidimensional arrays.
        </p>
        <p>
            The array format is as follows:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Byte</th>
                    <th>Contains</th>
                </tr><tr>
                    <td>0, 1</td>
                    <td>Number of x pixels, unsigned int. In <code>SCREEN 1</code>, this value is doubled.</td>
                </tr><tr>
                    <td>2, 3</td>
                    <td>Number of y pixels, unsigned int.</td>
                </tr><tr>
                    <td>4&#8212;</td>
                    <td>
                        Pixel data. Data is arranged in 2-byte words. The first 16-bit word holds the bit 0 of
                        the first 16 pixels on the top row. The second word holds the second bit,
                        etc. Data is word-aligned at the end of each row. Thus, in a screen mode
                        with 4 bits per pixel, the first row takes at least 8 bytes (4 words), even
                        if it consists of only one pixel. The number of bits per pixel depends on
                        the <code><a href="#SCREEN-statement">SCREEN</a></code> mode.
                    </td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>array_name</var></code> is the name of a numeric array dimensioned with enough space to store the area.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code>, <code><var>x1</var></code>, <code><var>y1</var></code> are numeric expressions.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In PCjr/Tandy mode, in <code>SCREEN 6</code>, <code>GET</code> stores an area of <em>twice the width</em>
                of the specified rectangle.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The array does not exist: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>array_name</var></code> refers to a string array: <samp>Type mismatch</samp>.
            </li>
            <li>
                The area is too large for the array: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, ... <code><var>y1</var></code> are string expressions: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, ... <code><var>y1</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, ... <code><var>y1</var></code> are outside the current <code>VIEW</code> or <code>WINDOW</code>:
                <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="GOSUB"><code>GOSUB</code> statement</h4>
        <code class="block">
            <b>GO</b>[ ]<b>SUB</b> <var>line_number</var> [<var>anything</var>]
        </code>
        <p>
            Jumps to a subroutine at <code><var>line_number</var></code>. The next
            <code><a href="#RETURN">RETURN</a></code> statement jumps back to
            the statement after <code>GOSUB</code>. Anything after <code><var>line_number</var></code> until the end of the
            statement is ignored. If executed from a direct line, <code>GOSUB</code> runs the subroutine and
            the following <code>RETURN</code> returns execution to the direct line.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is an existing line number literal.
            </li>
            <li>
                Further characters on
                the line are ignored until end of statement.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If no <code>RETURN</code> is encountered, no problem.
            </li>
            <li>
                One optional space is allowed between <code>GO</code> and <code>SUB</code>; it will not be retained in
                the program.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                If <code><var>line_number</var></code> does not exist: <samp>Undefined line number</samp>.
            </li>
            <li>
                If <code><var>line_number</var></code> is greater than <code>65529</code>, only the first 4 characters are
                read (e.g. <code>6553</code>)
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="GOTO"><code>GOTO</code> statement</h4>
        <code class="block">
            <b>GO</b>[ ]<b>TO</b> <var>line_number</var> [<var>anything</var>]
        </code>
        <p>
            Jumps to <code><var>line_number</var></code>.  Anything after <code><var>line_number</var></code> until the end of the
            statement is ignored. If executed from a direct line, <code>GOTO</code> starts execution of the program at the specified line.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is an existing line number literal.
            </li>
            <li>
                Further characters on
                the line are ignored until end of statement.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Any number of optional spaces is allowed between <code>GO</code> and <code>TO</code>, but they will
                not be retained in the program.
            </li>
            <li>
                If <code><var>line_number</var></code> is greater than <code>65529</code>, only the first 4 characters are
                read (e.g. <code>GOTO 65530</code> is executed as <code>GOTO 6553</code>)
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> does not exist: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="HEX$"><code>HEX$</code> function</h4>
        <code class="block">
            <var>hex_repr</var> <b>= HEX$(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns a string with the hexadecimal representation of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a
                numeric expression in <code>[-32768&#8212;65535]</code>. Values for
                negative <code><var>x</var></code> are shown as two's-complement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="IF"><code>IF</code> statement</h4>
        <code class="block">
            <b>IF</b> <var>truth_value</var> [<b>,</b>] {<b>THEN</b>|<b>GOTO</b>} [<var>statements_1</var>|<var>line_number_1</var> [<var>anything</var>]]
            [<b>ELSE</b> [<var>statements_0</var>|<var>line_number_0</var> [<var>anything</var>]]]
       </code>
        <p>
            If <code><var>truth_value</var></code> is non-zero, executes <code><var>statements_1</var></code> or jumps to <code><var>line_number_1</var></code> .
            If it is zero, executes <code><var>statements_0</var></code> or jumps to <code><var>line_number_0</var></code> .
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>truth_value</var></code>
                is a numeric expression.
            </li>
            <li>
                <code><var>line_number_0</var></code> and <code><var>line_number_1</var></code> are existing line numbers.
            </li>
            <li>
                Statements <code><var>statements_0</var></code> and <code><var>statements_1</var></code> can be compound statements with
                one or more colons (<code>:</code>) separating single statements. The compound statements
                can contain nested <code>IF&#8212;THEN&#8212;ELSE</code> statements.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The comma is optional and ignored.
            </li>
            <li>
                <code><a href="#ELSE">ELSE</a></code> clauses are optional; they
                are bound to the innermost free <code>IF</code> statement if nested. Additional <code>ELSE</code>
                clauses that have no matching <code>IF</code> are ignored.
            </li>
            <li>
                All clauses must be on the same
                program line.
            </li>
            <li>
               <code>THEN</code> and <code>GOTO</code> are interchangeable; which one is chosen is independent
                of whether a statement or a line number is given. <code>GOTO PRINT 1</code> is fine.
            </li>
            <li>
                As in <code><a href="#GOTO">GOTO</a></code>, anything after the line number is ignored.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
               If <code><var>truth_value</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>truth_value</var></code> equals <code>0</code> and <code><var>line_number_0</var></code> is a non-existing line number,
                or
                <code><var>truth_value</var></code> equals <code>1</code> and <code><var>line_number_1</var></code> is a non-existing line number:
                <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="INKEY$"><code>INKEY$</code> function</h4>
        <code class="block">
            <var>key</var> <b>= INKEY$</b>
        </code>
        <p>
            Returns one key-press from the keyboard buffer. If the keyboard buffer is
            empty, returns the empty string. Otherwise, the return value is a one- or two-
            character string holding the <a href="#eascii">e-ASCII code</a> of the pressed key.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This function has no brackets.
            </li>
            <li>
                When a function key <kbd>F1</kbd>&#8211;<kbd>F10</kbd> is pressed,
                <code>INKEY$</code> will return the letters of the associated macro
                &#8212; unless this macro has been set to empty with the
                <code><a href="#KEY-def">KEY</a></code> statement, in which case
                it returns the e-ASCII code for the function key.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="INP"><code>INP</code> function</h4>
        <code class="block">
            <var>code</var> <b>= INP(</b><var>port</var><b>)</b>
        </code>
        <p>
            Returns the value of an emulated machine port.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>port</var></code> is a numeric expression in <code>[0&#8212;65535]</code>.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code>port</code></th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>&amp;H60</code></td>
                    <td>
                        Returns the keyboard scancode for the current key pressed or the last key released.
                        The scancodes returned by <code>INP(&amp;H60)</code> are those
                        listed in the <a href="#scancodes">keyboard scancodes table</a>.
                        If a key is currently down, the return value is its scancode.
                        If no key is down, the return value is the scancode of
                        the last key released, incremented by 128.
                    </td>
                </tr>
                <tr>
                    <td><code>&amp;H201</code></td>
                    <td>
                        Returns the value of the game port (joystick port). This value is
                        constructed as follows:
                        <table>
                            <tr>
                                <th>Bit</th>
                                <th>Meaning</th>
                            </tr>
                            <tr>
                                <td>0</td>
                                <td>joystick 2 x-axis</td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>joystick 1 y-axis</td>
                            </tr>
                            <tr>
                                <td>2</td>
                                <td>joystick 1 x-axis</td>
                            </tr>
                            <tr>
                                <td>3</td>
                                <td>joystick 2 y-axis</td>
                            </tr>
                            <tr>
                                <td>4</td>
                                <td>joystick 2 button 1</td>
                            </tr>
                            <tr>
                                <td>5</td>
                                <td>joystick 1 button 2</td>
                            </tr>
                            <tr>
                                <td>6</td>
                                <td>joystick 1 button 1</td>
                            </tr>
                            <tr>
                                <td>7</td>
                                <td>joystick 2 button 2</td>
                            </tr>
                        </table>
                        The button bits are 0 when the button is fired, 1 otherwise. The axis values
                        are normally 0 but are set to 1 by <code><a href="#OUT">OUT</a> &amp;H201, <var>x</var></code> and then fall back to 0
                        after a delay. The longer the delay, the higher the axis value.
                    </td>
                </tr>
                <tr>
                    <td>other values</td>
                    <td>Returns zero.</td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul>
            <li>
                Only a limited number of machine ports are emulated in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>port</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>port</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="INPUT"><code>INPUT</code> statement (console)</h4>
        <code class="block">
            <b>INPUT</b> [<b>;</b>] [<var>prompt</var> {<b>;</b>|<b>,</b>}] <var>var_0</var> [<b>,</b> <var>var_1</var>] ...
        </code>
        <p>
            Prints <code><var>prompt</var></code> to the screen and waits for the user to input values for the specified variables.
            The semicolon before the prompt, if present,
            stops a newline from being printed after the values have been entered.
            If the prompt is followed by a semicolon, it is printed with a trailing <code>?</code>. If
            the prompt is followed by a comma, no question mark is added.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>prompt</var></code> is a string literal.
            </li>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are variable names or fully indexed array elements.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Values entered must be separated by commas. Leading and trailing whitespace
                is discarded.
            </li>
            <li>
                String values can be entered with or without double quotes (<code>"</code>).
            </li>
            <li>
                If a string with a comma, leading or trailing whitespace is needed,
                quotes are the only way to enter it.
            </li>
            <li>
                Between a closing quote and the comma at the end of the entry, only white-
                space is allowed.
            </li>
            <li>
                If quotes are needed in the string itself, the first character must be
                neither a quote nor whitespace. It is not possible to enter a string that
                starts with a quote through <code>INPUT</code>.
            </li>
            <li>
                If a given <code><var>var_n</var></code> is a numeric variable, the value entered must be
                number literal.
            </li>
            <li>
                Characters beyond the 255th character of the screen line are discarded.
            </li>
            <li>
                If user input is interrupted by <kbd>Ctrl</kbd>+<kbd>Break</kbd>,
                <code><a href="#CONT">CONT</a></code> will re-execute the
                <code>INPUT</code> statement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                If the value entered for a numeric variable is not a valid numeric literal,
                or the number of values entered does not match the number of variables in
                the statement,
                <samp>?Redo from start</samp> is printed and all values must be entered again.
            </li>
            <li>
                A <samp>Syntax error</samp> that is caused after the prompt is printed is only raised
                after the value shave been entered. No values are stored.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="INPUT-file"><code>INPUT</code> statement (devices and files)</h4>
        <code class="block">
            <b>INPUT #</b> <var>file_num</var><b>,</b> <var>var_0</var> [<b>,</b> <var>var_1</var>] ...
        </code>
        <p>
            Reads string or numeric variables from a text file, device, or the <code>FIELD</code> buffer
            of a random access file.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> is the number of a file open in
                <code>INPUT</code> mode or a device or random-access file open in <code>RANDOM</code> mode.
            </li>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are variable names or fully indexed array elements.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The <code>#</code> is mandatory. There may or may not be whitespace between <code>INPUT</code> and <code>#</code>.
            </li>
            <li>
                String values can be entered with or without double quotes (<code>"</code>).
            </li>
            <li>
                Numeric values are terminated by <code>&#160;</code>, <code>LF</code>, <code>CR</code>, <code>,</code>.
            </li>
            <li>
                Unquoted strings are terminated by <code>LF</code>, <code>CR</code>, <code>,</code>.
            </li>
            <li>
                Quoted strings are terminated by the closing quote.
            </li>
            <li>
                Any entry is terminated by <code>EOF</code> character or its 255th character.
            </li>
            <li>
                Leading and trailing whitespace is discarded.
            </li>
            <li>
                If the entry cannot be converted to the requested type, a zero value is
                returned.
            </li>
            <li>
                If <code><var>file_num</var></code> is open to <code>KYBD:</code>, <code>INPUT#</code> reads from the keyboard until a
                return or comma is encountered (as in a file). Arrow keys and delete are
                passed as their control characters (<em>not</em> scancodes!) preceded by <code><a href="#CHR%24">CHR$</a>(&amp;HFF)</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Input is requested after the end of a text file has been reached or an
                <code>EOF</code> character has been encountered: <samp>Input past end</samp>.
            </li>
            <li>
                The last character of the field buffer is read: <samp>Field overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is greater than <code>32767</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is less than zero: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not open for <code>INPUT</code> or <code>RANDOM</code>: <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open to a <code>COM</code> port and this is the
                first <code><a href="#INPUT-file">INPUT</a></code>, <code><a href="#LINE-INPUT-file">LINE INPUT</a></code> or <code><a href="#INPUT%24">INPUT$</a></code> call on that port
                since the buffer has filled up completely (i.e. <code><a href="#LOF">LOF</a>(<var>file_num</var>)</code> has become zero):
                <samp>Communication buffer overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="INPUT$"><code>INPUT$</code> function</h4>
        <code class="block">
            <var>chars</var> <b>= INPUT</b>[ ]<b>$</b> <b>(</b><var>num_chars</var> [<b>,</b> [<b>#</b>] <var>file_num</var>]<b>)</b>
        </code>
        <p>
            Returns a string of <code><var>num_chars</var></code> characters from the keyboard or,
            if <code><var>file_num</var></code> is provided, from a text file.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>num_chars</var></code> is a numeric expression in <code>[1&#8212;255]</code>.
            </li>
            <li>
                <code><var>file_num</var></code> is a numeric expression that returns the number of a text file opened in
                <code>INPUT</code> mode. The <code>#</code> is optional and has no effect.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                This is a blocking read. It will wait for characters if there are none
                in the buffer.
            </li>
            <li>
                All control characters except <kbd>Ctrl</kbd>+<kbd>Break</kbd>, <kbd>Ctrl</kbd>+<kbd>Scroll Lock</kbd> and <kbd>Pause</kbd>
                are passed to the string by <code>INPUT$</code>. <kbd>Ctrl</kbd>+<kbd>Break</kbd> and <kbd>Ctrl</kbd>+<kbd>Scroll Lock</kbd> break
                execution whereas <kbd>Pause</kbd> halts until another key is pressed (and not read).
            </li>
            <li>
                When reading from the keyboard directly or through <code>KYBD:</code>, arrow keys, <kbd>Del</kbd>,
                <kbd>Home</kbd>, <kbd>End</kbd>, <kbd>Pg Up</kbd>, <kbd>Pg Dn</kbd> are passed as <code>NUL</code> characters. Function keys
                are ignored if they are event-trapped, otherwise keyword replacement is
                active as normal.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num_chars</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is less than zero: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is greater than <code>32767</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not open for <code>INPUT</code>: <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> or <code><var>file_num</var></code> are strings: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open to a <code>COM</code> port and this is the
                first <code><a href="#INPUT-file">INPUT</a></code>, <code><a href="#LINE-INPUT-file">LINE INPUT</a></code> or <code><a href="#INPUT%24">INPUT$</a></code> call on that port
                since the buffer has filled up completely (i.e. <code><a href="#LOF">LOF</a>(<var>file_num</var>)</code> has become zero):
                <samp>Communication buffer overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="INSTR"><code>INSTR</code> function</h4>
        <code class="block">
            <var>position</var> <b>= INSTR(</b>[<var>start</var><b>,</b>] <var>parent</var><b>,</b> <var>child</var><b>)</b>
        </code>
        <p>
            Returns the location of the first occurrence of the substring <code><var>child</var></code> in
            <code><var>parent</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>parent</var></code> and <code><var>child</var></code> are string expressions.
            </li>
            <li>
                <code><var>start</var></code> is a numeric expression in <code>[1&#8212;255]</code>, specifying
                the starting position from where to look; if not specified, the search starts
                at character 1.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>child</var></code> is not a substring of <code><var>parent</var></code> occurring at or before <code><var>start</var></code>,
                <code>INSTR</code> returns 0.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>start</var></code> has a string value or <code><var>parent</var></code> or <code><var>child</var></code> have numeric values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>start</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>start</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="INT"><code>INT</code> function</h4>
        <code class="block">
            <var>whole</var> <b>= INT(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns <code><var>number</var></code> truncated towards negative infinity.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code><a href="#FIX">FIX</a></code> truncates towards zero: it removes the
                fractional part. By contrast, <code>INT</code> truncates towards negative infinity.
                For negative <code><var>x</var></code>, <code>FIX(<var>x</var>)-INT(<var>x</var>)=1</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a string expression, <samp>Type mismatch</samp> .
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="IOCTL"><code>IOCTL</code> statement</h4>
        <code class="block">
            <b>IOCTL</b> [<b>#</b>] <var>file_num</var><b>,</b> <var>control_string</var>
        </code>
        <p>
            Raises <samp>Illegal function call</samp>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, <code>IOCTL</code> sends a control string to a device.
            </li>
            <li>
                This statement is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
               Otherwise: <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="IOCTL$"><code>IOCTL$</code> function</h4>
        <code class="block">
            <var>result</var> <b>= IOCTL</b>[ ]<b>$ (</b>[<b>#</b>] <var>file_num</var><b>)</b>
        </code>
        <p>
            Raises <samp>Illegal function call</samp>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, <code>IOCTL$</code> reads the reply to
                <code><a href="#IOCTL">IOCTL</a></code> from a device.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                Otherwise: <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="KEY-list"><code>KEY</code> statement (function-key macro list)</h4>
        <code class="block">
            <b>KEY</b> {<b>ON</b>|<b>OFF</b>|<b>LIST</b>}
        </code>
        <p>
            Turns the list of function-key macros on the bottom of the screen <code>ON</code> or <code>OFF</code>.
            If <code>LIST</code> is specified, prints a list of
            the 10 function keys with the function-key macros defined for those keys to the console. Special
            characters are represented by their symbol equivalent in the loaded codepage.
            Some characters get a special representation: e.g. <code><a href="#CHR%24">CHR$</a>(13)</code> is represented
            as a back arrow.
        </p>
    </section>
<hr>

    <section>
        <h4 id="KEY-def"><code>KEY</code> statement (function-key macro definition)</h4>
        <code class="block">
            <b>KEY</b> <var>key_id</var><b>,</b> <var>string_value</var>
        </code>
        <p>
            Defines the string macro for function key <code><var>key_id</var></code>.
            Only the first 15 characters of <code><var>string_value</var></code> are stored.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is a numeric expression in the range <code>[1&#8212;10]</code>.
            </li>
            <li>
                <code><var>string_value</var></code> is a string expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>key_id</var></code> is not in the range <code>[1&#8212;10]</code>,
                the statement is interpreted as an
                event-trapping <code><a href="#KEY-event">KEY</a></code> statement.
            </li>
            <li>
                If <code><var>string_value</var></code> is the empty string or
                the first character of <code><var>string_value</var></code> is
                <code>CHR$(0)</code>, the function key macro is switched off and
                subsequent catching of the associated function key with
                <code><a href="#INKEY%24">INKEY$</a></code> is enabled.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="KEY-event"><code>KEY</code> statement (event-trapping switch)</h4>
        <code class="block">
            <b>KEY</b> <b>(</b><var>key_id</var><b>)</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <p>
            Controls event trapping of the key with identifier <code><var>key_id</var></code>.
            Event trapping is switched <code>ON</code> or <code>OFF</code>. <code>STOP</code> suspends event trapping until
            a <code>KEY() ON</code> is executed. Up to one event can be triggered during
            suspension, provided that event handling was switched on prior to suspension.
            The event triggered during suspension is handled immediately after the next <code>KEY() ON</code>
            statement.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>key_id</var></code> is a numeric expression in <code>[1&#8212;20]</code>.
            Keys are:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td>1</td>
                    <td><kbd>F1</kbd></td>
                </tr>
                <tr>
                    <td>2</td>
                    <td><kbd>F2</kbd></td>
                </tr>
                <tr>
                    <td>3</td>
                    <td><kbd>F3</kbd></td>
                </tr>
                <tr>
                    <td>4</td>
                    <td><kbd>F4</kbd></td>
                </tr>
                <tr>
                    <td>5</td>
                    <td><kbd>F5</kbd></td>
                </tr>
                <tr>
                    <td>6</td>
                    <td><kbd>F6</kbd></td>
                </tr>
                <tr>
                    <td>7</td>
                    <td><kbd>F7</kbd></td>
                </tr>
                <tr>
                    <td>8</td>
                    <td><kbd>F8</kbd></td>
                </tr>
                <tr>
                    <td>9</td>
                    <td><kbd>F9</kbd></td>
                </tr>
                <tr>
                    <td>10</td>
                    <td><kbd>F10</kbd></td>
                </tr>
                <tr>
                    <td>11</td>
                    <td><kbd>&#8593;<!--up--></kbd></td>
                </tr>
                <tr>
                    <td>12</td>
                    <td><kbd>&#8592;<!--left--></kbd></td>
                </tr>
                <tr>
                    <td>13</td>
                    <td><kbd>&#8594;<!--right--></kbd></td>
                </tr>
                <tr>
                    <td>14</td>
                    <td><kbd>&#8595;<!--down--></kbd></td>
                </tr>
            </table>
        </div>
        <p>
            Keys 15 to 20 are defined using the event trapping
            <code><a href="#KEY-event-def">KEY</a></code> definition statement.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                With <code><a href="#--syntax">--syntax</a>=tandy</code>, key 11
                is <kbd>F11</kbd> and key 12 is <kbd>F12</kbd>.
                Pre-defined keys 11&#8212;14 shift to 13&#8212;16.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> is not in <code>[0&#8212;20]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="KEY-event-def"><code>KEY</code> statement (event-trapping key definition)</h4>
        <code class="block">
            <b>KEY</b> <var>key_id</var><b>,</b> <var>two_char_string</var>
        </code>
        <p>
            Defines the key to trap for <code><var>key_id</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is a numeric
                expression in <code>[15&#8212;20]</code>.
            </li>
            <li>
                <code><var>two_char_string</var></code> is a string expression of length 2. The first character is interpreted as a modifier
                while the second character is interpreted as a scancode. See <code><a href="#INP">INP</a></code> for scancodes.
                The modifier character is a bitwise <code>OR</code> combination of the following flags:
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code>CHR$(&amp;h80)</code></td>
                            <td>Extended</td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h40)</code></td>
                            <td><kbd>Caps Lock</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h20)</code></td>
                            <td><kbd>Num Lock</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h08)</code></td>
                            <td><kbd>Alt</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h04)</code></td>
                            <td><kbd>Ctrl</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h02)</code></td>
                            <td><kbd>Shift</kbd> (either side)</td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h01)</code></td>
                            <td><kbd>Shift</kbd> (either side)</td>
                        </tr>
                    </table>
                </div>
                For the unmodified key, the modifier character is <code>CHR$(0)</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>key_id</var></code> is not in <code>[15&#8212;20]</code>, no error is raised; such values are ignored.
                In GW-BASIC strange things can
                happen in this case: screen anomalies and crashes suggestive of unintended
                memory access.
            </li>
            <li>
                If <code><var>key_id</var></code> is in <code>[1&#8212;10]</code>, the statement is interpreted as a
                <a href="#KEY-def">function-key macro definition</a>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>two_char_string</var></code> is longer than two: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>two_char_string</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="KILL"><code>KILL</code> statement</h4>
        <code class="block">
            <b>KILL</b> <var>file_path</var>
        </code>
        <p>
            Deletes a file on a disk device.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_path</var></code> is a string expression that specifies a
                valid path to an existing file. The extension
                must be specified: no default extensions are assumed.
                Refer to the section on <a href="#eightpointthree">MS-DOS filenames</a> for information on how this statement matches filenames.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_path</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
            <li>
                The file <code><var>file_path</var></code> is open: <samp>File already open</samp>
            </li>
            <li>
                The file or path <code><var>file_path</var></code> does not exist: <samp>File not found</samp>
            </li>
            <li>
                The user has no write permission: <samp>Permission denied</samp>
            </li>
            <li>
                If a syntax error occurs after the closing quote, the file is removed    anyway.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LCOPY"><code>LCOPY</code> statement</h4>
        <code class="block">
            <b>LCOPY</b> [<var>num</var>]
        </code>
        <p>
            Does nothing.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>num</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                This statement does nothing in GW-BASIC. Presumably, it is left over from a
                statement in older versions of MS Basic that would copy the screen to the
                printer.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LEFT$"><code>LEFT$</code> function</h4>
        <code class="block">
            <var>child</var> <b>= LEFT$(</b><var>parent</var><b>,</b> <var>num_chars</var><b>)</b>
        </code>
        <p>
            Returns the leftmost <code><var>num_chars</var></code> characters of <code><var>parent</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>parent</var></code> is a string expression.
            </li>
            <li>
                <code><var>num_chars</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>num_chars</var></code> is zero or <code><var>parent</var></code> is empty, <code>LEFT$</code> returns
                an empty string.
            </li>
            <li>
                If <code><var>num_chars</var></code> is greater than the length of <code><var>parent</var></code>,
                returns <code><var>parent</var></code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>parent</var></code> has a numeric value or <code><var>num_chars</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LEN"><code>LEN</code> function</h4>
        <code class="block">
            <var>length</var> <b>= LEN(</b><var>string</var><b>)</b>
        </code>
        <p>
            Returns the number of characters in <code><var>string</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string</var></code> is a string
                expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LET"><code>LET</code> statement</h4>
        <code class="block">
            [<b>LET</b>] <var>name</var> <b>=</b> <var>expression</var>
        </code>
        <p>
            Assigns the value of <code><var>expression</var></code> to the variable or array element <code><var>name</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> is a variable that may or may not already exist.
            </li>
            <li>
                The
                type of <code><var>expression</var></code> matches that of <code><var>name</var></code>: that is, all numeric types can
                be assigned to each other but strings can only be assigned to strings.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>name</var></code> and <code><var>expression</var></code> are not of matching types: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LINE"><code>LINE</code> statement</h4>
        <code class="block">
            <b>LINE</b> [[<b>STEP</b>] <b>(</b><var>x0</var><b>,</b> <var>y0</var><b>)</b>] <b>-</b> [<b>STEP</b>]
            <b>(</b><var>x1</var><b>,</b> <var>y1</var><b>)</b> [<b>,</b> [<var>attr</var>] [<b>,</b> [<b>B</b> [<b>F</b>]] [<b>,</b> <var>pattern</var>]]]
        </code>
        <p>
            Draws a line or a box in graphics mode. If <code>B</code> is not specified, a line is drawn
            from <code>(<var>x0</var>, <var>y0</var>)</code> to <code>(<var>x1</var>, <var>y1</var>)</code>, endpoints inclusive.
            If <code>B</code> is specified, a
            rectangle is drawn with sides parallel to the screen and two opposing corners
            specified by <code>(<var>x0</var>, <var>y0</var>)</code> and <code>(<var>x1</var>, <var>y1</var>)</code>. If the starting point is not given,
            the current graphics position is used as a staring point.  If <code>STEP</code> is
            specified, <code>(<var>x0</var>, <var>y0</var>)</code> is an offset from the current position and <code>(<var>x1</var>, <var>y1</var>)</code> is an
            offset from <code>(<var>x0</var>, <var>y0</var>)</code>.
            <code>LINE</code> moves the current graphics position to the last given endpoint.
            If <code>F</code> is specified with <code>B</code>, the rectangle is filled with the specified attribute.
            <code>F</code> and <code>B</code> may be separated by zero or more spaces.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>attr</var></code> is a numeric expression in <code>[0&#8212;255]</code>, which
                specifies the colour attribute of the line. If it is not given, the current
                attribute is used.
            </li>
            <li>
                <code><var>pattern</var></code> is a numeric expression in <code>[-32768&#8212;32767]</code>.
                This is interpreted as a 16-bit binary pattern mask
                applied to consecutive pixels in the line: a 1 bit indicates a pixel
                plotted; a 0 bit indicates a pixel left untouched. The pattern starts at
                the most significant bit, which is applied to the topmost endpoint. If a
                box is drawn, the pattern is applied in the following counter-intuitive
                sequence: <code>(<var>x1</var>, <var>y1</var>)&#8212;(<var>x0</var>, <var>y1</var>)</code>,
                <code>(<var>x1</var>, <var>y0</var>)&#8212;(<var>x0</var>, <var>y0</var>)</code>,
                then <code>(<var>x1</var>, <var>y0</var>)&#8212;(<var>x1</var>, <var>y1</var>)</code>,
                <code>(<var>x0</var>, <var>y0</var>)&#8212;(<var>x0</var>, <var>y1</var>)</code> if <code><var>y0</var>&lt;<var>y1</var></code> and <code><var>y0</var></code>,
                <code><var>y1</var></code> reversed if <code><var>y1</var>&lt;<var>y0</var></code>. When drawing a
                filled box, <code>LINE</code> ignores the pattern.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If a coordinate is outside the screen boundary, it is replaced with -1 (if
                less than 0) or the screen dimension (if larger than the screen dimension).
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The statement ends in a comma and it is the first or third: <samp>Missing operand</samp>. If it is the second: <samp>Syntax error</samp>.
            </li>
            <li>
                Any of the coordinates is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LINE-INPUT"><code>LINE INPUT</code> statement (console)</h4>
        <code class="block">
            <b>LINE INPUT</b> [<b>;</b>] [<var>prompt_literal</var> {<b>;</b>|<b>,</b>}] <var>string_name</var>
        </code>
        <p>
            Displays the prompt given in <code><var>prompt_literal</var></code> and reads user input from the
            keyboard, storing it into the variable <code><var>string_name</var></code>. All input is read until
            <kbd>Enter</kbd> is pressed; the first 255 characters are stored. If the <code>;</code> is given
            right after <code>LINE INPUT</code>, the <kbd>Enter</kbd> ending user input is not echoed to the
            screen.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>prompt_literal</var></code> is a string literal. It makes no difference whether it is
                followed by a comma or a semicolon.
            </li>
            <li>
                <code><var>string_name</var></code> is a string variable or array element.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If user input is interrupted by <kbd>Ctrl</kbd>+<kbd>Break</kbd>, <code>CONT</code> will re-execute the <code>LINE
                INPUT</code> statement.
            </li>
            <li>
                Unlike <code><a href="#INPUT">INPUT</a></code>, <code>LINE INPUT</code>
                does not end the prompt with <code>?</code>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LINE-INPUT-file"><code>LINE INPUT</code> statement (files)</h4>
        <code class="block">
            <b>LINE INPUT</b> <b>#</b> <var>file_num</var><b>,</b> <var>string_name</var>
        </code>
        <p>
            Reads string or numeric variables from a text file, device, or the <code>FIELD</code> buffer
            of a random access file. All input is read until <kbd>Enter</kbd> is pressed; the first
            255 characters are stored. <code><var>file_num</var></code> must be the number of a file open in
            <code>INPUT</code> mode or a device or random-access file open in <code>RANDOM</code> mode.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is a string variable or array element.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The <code>#</code> is mandatory. There may or may not be whitespace between <code>INPUT</code> and <code>#</code>.
            </li>
            <li>
                Input is only terminated by a <code>CR</code>.
            </li>
            <li>
                If <code><var>file_num</var></code> is open to <code>KYBD:</code>, <code>LINE INPUT#</code> reads from the keyboard until a
                return or comma is encountered (as in a file). Arrow keys and delete are
                passed as their control characters (<em>not</em> scancodes!) preceded by <code>CHR$(&amp;HFF)</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Input is requested after the end of a text file has been reached or an
                <code>EOF</code> char has been encountered: <samp>Input past end</samp>.
            </li>
            <li>
                The last character of the field buffer is read: <samp>Field overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is less than zero: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not open for <code>INPUT</code> or <code>RANDOM</code>: <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open to a <code>COM</code> port and this is the
                first <code><a href="#INPUT-file">INPUT</a></code>, <code><a href="#LINE-INPUT-file">LINE INPUT</a></code> or <code><a href="#INPUT%24">INPUT$</a></code> call on that port
                since the buffer has filled up completely (i.e. <code><a href="#LOF">LOF</a>(<var>file_num</var>)</code> has become zero):
                <samp>Communication buffer overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LIST"><code>LIST</code> statement</h4>
        <code class="block">
            <b>LIST</b> [<var>line_number_0</var>|<b>.</b>] [<b>-</b>[<var>line_number_1</var>|<b>.</b>]] [<b>,</b> <var>file_spec</var>]
        </code>
        <p>
            Prints the program to the screen or a specified device,
            starting with <code><var>line_number_0</var></code> up to and
            including <code><var>line_number_1</var></code>.
            Also stops program execution and returns control to the user. Any further
            statements on a line after <code>LIST</code> will be ignored, both in a program and in interactive mode.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number_0</var></code> and <code><var>line_number_1</var></code> are  line numbers in the range <code>[0&#8212;65529]</code>.
                or a <code>.</code> to indicate the last line edited. The line numbers do not need to exist;
                they specify a range. If the range is empty, nothing is printed.
            </li>
            <li>
                <code><var>file_spec</var></code> is a string expression indicating the device and file name to list to.
                If this file already exists, it will be overwritten.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                A line number is greater than <code>65529</code>: <samp>Syntax error</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> ends in a colon but is not a device name or drive letter:
                <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LLIST"><code>LLIST</code> statement</h4>
        <code class="block">
            <b>LLIST</b> [<var>line_number_0</var>|<b>.</b>] [<b>-</b>[<var>line_number_1</var>|<b>.</b>]]
        </code>
        <p>
            Prints the program to the screen, starting with <code><var>line_number_0</var></code> up to and
            including <code><var>line_number_1</var></code>.
            Also stops program execution and returns control to the user. Any further
            statements on a line after <code>LLIST</code> will be ignored, both in a program and in interactive mode.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number_0</var></code> and <code><var>line_number_1</var></code> are  line numbers in the range <code>[0&#8212;65529]</code>.
                or a <code>.</code> to indicate the last line edited. The line numbers do not need to exist;
                they specify a range. If the range is empty, nothing is printed.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                A line number is greater than <code>65529</code>: <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LOAD"><code>LOAD</code> statement</h4>
        <code class="block">
            <b>LOAD</b> <var>file_spec</var> [<b>, R</b>]
        </code>
        <p>
            Loads the program stored in a file into memory.
            If <code>,R</code> is specified, runs the file after loading.
            <code>LOAD ,R</code> keeps all data files open. Existing variables will be
            cleared and any program in memory will be erased. <code>LOAD</code> implies a
            <code><a href="#CLEAR">CLEAR</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is a string expression indicating
                the device and file to read the program from. See the <a href="#OPEN">OPEN</a>
                statement for valid file specifications. Refer to
                the section on <a href="#eightpointthree">file names on disk</a>
                for information on how this statement matches filenames on a disk
                device.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Refer to
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                The file specified in <code><var>file_spec</var></code>
                cannot be found: <samp>File not found</samp>.
            </li>
            <li>
                A loaded ASCII file contains lines without line numbers:
                <samp>Direct statement in file</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LOC"><code>LOC</code> function</h4>
        <code class="block">
            <var>location</var> <b>= LOC(</b><var>file_num</var><b>)</b>
        </code>
        <p>
            Returns the current location in the file opened under number <code><var>file_num</var></code>.
        </p>
        <ul>
            <li>
                If the file is opened for <code>INPUT</code>, <code>OUTPUT</code> or <code>APPEND</code>, <code>LOC</code> returns the number
                of 128-byte blocks read or written since opening the file.
            </li>
            <li>
                If the file is opened for <code>RANDOM</code>, <code>LOC</code> returns the record number last read or
                written.
            </li>
            <li>
                If the file is opened to a <code>COM</code> device, <code>LOC</code> returns the number of characters
                in the input buffer, with a maximum of 255.
            </li>
            <li>
                If the file is opened to <code>KYBD:</code>, <code>LOC</code> returns 0.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> is a numeric expression in the range <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
               <code><var>file_num</var></code> must not be preceded by a <code>#</code>.
            </li>
            <li>
                In <code>OUTPUT</code> or <code>APPEND</code> mode, before any writes  <code>LOC</code> returns 0. After the 128th
                character is written,  <code>LOC</code> returns 1.
            </li>
            <li>
                In <code>INPUT</code> mode, before any reads  <code>LOC</code> returns 1. After the <strong>129th</strong> character
                is read, <code>LOC</code> returns 2.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open for output to a device: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LOCATE"><code>LOCATE</code> statement</h4>
        <code class="block">
            <b>LOCATE</b> [<var>row</var>] [<b>,</b> [<var>col</var>] [<b>,</b> [<var>cursor_visible</var>] [<b>,</b> [<var>start_line</var>] [<b>,</b> [<var>stop_line</var>] [<b>,</b>]]]]]
        </code>
        <p>
            Positions the cursor at <code><var>row</var></code>, <code><var>col</var></code> on the screen and changes the cursor shape and visibility.
            <code><var>cursor_visible</var></code> may be 0 or 1. If <code><var>cursor_visible</var></code> is 0, it makes
            the cursor invisible; if it is 1, makes the cursor visible. This works only while a program is running.
             The cursor shape is adjusted
             within a character cell to start from <code><var>start_line</var></code> and end on <code><var>end_line</var></code> where
            <code><var>start_line</var></code> and <code><var>end_line</var></code> are in <code>[0&#8212;31]</code>. If <code><var>start_line</var></code> or <code><var>end_line</var></code> is
            greater than the character cell height (15), substitute 15.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                On emulated VGA cards, the cursor shape parameters are interpreted
                in a complicated way that is intended to maintain functional compatibility with CGA.
            </li>
            <li>
                In GW-BASIC, cursor shape is preserved after pressing <kbd>Ins</kbd> twice. The insert-mode cursor is different from the usual half-block.
                In PC-BASIC, insert mode resets the cursor shape to default.
            </li>
            <li>
                Cursor shape and visibility options have no effect in graphics mode.
            </li>
            <li>
                Locate accepts a 5th comma at the end, which is ignored.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any parameter is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>row</var></code> is outside the current view area: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>col</var></code> is greater than the current width: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>cursor_visible</var></code> is not in <code>[0, 1]</code> (<code>[0&#8212;255]</code> on Tandy/PCjr): <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LOCK"><code>LOCK</code> statement</h4>
        <code class="block">
            <b>LOCK</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>record_0</var>]
        </code>
        <code class="block">
            <b>LOCK</b> [<b>#</b>] <var>file_number</var><b>,</b> [<var>record_0</var>] <b>TO</b> <var>record_1</var>
        </code>
        <p>
            Locks a file or part of a file against access by other users. On a <code>RANDOM</code> file,
            <code><var>record_0</var></code> is the first record locked and <code><var>record_1</var></code> is the last
            record locked. On any other kind of file <code><var>record_0</var></code> and <code><var>record_1</var></code> have no
            effect. If <code><var>record_0</var></code> is not specified, it is assumed to be 1. If no records
            are specified, the whole file is locked.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
            <li>
                <code><var>record_0</var></code> and <code><var>record_1</var></code> are numeric expressions in <code>[1&#8212;2^25-2]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC under MS-DOS, the <code>LOCK</code> command requires <code>SHARE.EXE</code> to be loaded.
                The maximum number of locks is specified in the MS-DOS <code>SHARE</code> command. If <code>SHARE</code> has
                not been activated or all locks are used, <code>LOCK</code> raises <samp>Permission denied</samp>.
                PC-BASIC behaves as if <code>SHARE</code> has been activated with unlimited locks.
            </li>
            <li>
                If <code><var>file_number</var></code> is open for <code>RANDOM</code>,
                <code><a href="#LOCK">LOCK</a></code> and <code><a href="#UNLOCK">UNLOCK</a></code>
                statements must match in terms of <code><var>record_0</var></code> and
                <code><var>record_1</var></code>. An non-matching <code>UNLOCK</code> will raise
                <samp>Permission denied</samp>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code>LOCK</code> (part of) a file already locked: <samp>Permission denied</samp>.
            </li>
            <li>
                <code><var>record_0</var></code> or <code><var>record_1</var></code> is not in <code>[1&#8212;2^25-2]</code>: <samp>Bad record number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LOF"><code>LOF</code> function</h4>
        <code class="block">
            <var>length</var> <b>= LOF(</b><var>file_num</var><b>)</b>
        </code>
        <p>
            Returns the number of bytes in the file open under <code><var>file_num</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> is a numeric expression in the range <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>file_num</var></code> is open to a <code>COM:</code> device, <code>LOF</code> returns the number of bytes
                free in the input buffer.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open for output to a device: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LOG"><code>LOG</code> function</h4>
        <code class="block">
            <var>y</var> <b>= LOG(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the natural logarithm of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a numeric expression greater than zero.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">--double</a></code>
                option, this function returns a single-precision value.
            </li>
            <li>
               <code>LOG(<var>x</var>)</code> can differ from GW-BASIC by 1 in the least significant digit.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is zero or negative: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LPOS"><code>LPOS</code> function</h4>
        <code class="block">
            <var>position</var> <b>= LPOS(</b><var>printer_number</var><b>)</b>
        </code>
        <p>
            Returns the column position for a printer.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>printer_number</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
                If it is 0
                or 1, the position for <code>LPT1:</code> is returned. If it is 2, <code>LPT2:</code>; 3, <code>LPT3:</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, when entering direct mode, <code>LPT1:</code> (but not other printers)
                is flushed and its position is reset to 1. This is not implemented in
                PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>printer_number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>printer_number</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>printer_number</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="LPRINT"><code>LPRINT</code> statement</h4>
        <p>
            See <code><a href="#PRINT">PRINT</a></code>.
        </p>
    </section>
<hr>

    <section>
        <h4 id="LSET"><code>LSET</code> and <code>RSET</code> statements</h4>
        <code class="block">
            {<b>LSET</b>|<b>RSET</b>} <var>string_name</var> <b>=</b> <var>expression</var>
        </code>
        <p>
            Assigns a value to a <code><a href="#FIELD">FIELD</a></code> variable such that
            it overwrites the <code>FIELD</code> record.
            With <code>LSET</code>, the value will be left-justified if it is shorter than the length of
            the <code>FIELD</code> variable and the remaining characters are replaced by
            spaces. <code>RSET</code> does the same but the value will be right-justified.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is a string variable.
            </li>
                <li><code><var>expression</var></code> is a string expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>string_name</var></code> is not a <code>FIELD</code> variable, the value is justified into the
                existing string, which retains its length.
            </li>
            <li>
                If <code><var>expression</var></code> has a value that is longer than the length of the variable,
                it is truncated at the back at the length of the variable.
            </li>
            <li>
                If <code><a href="#LET">LET</a></code> is used on a <code>FIELD</code> variable
                instead of <code>L|RSET</code>, the variable is
                detached from the field and becomes a normal string variable.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is not a string variable: <samp>Type mismatch</samp>.
                <code><var>expression</var></code> does not have a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="MERGE"><code>MERGE</code> statement</h4>
        <code class="block">
            <b>MERGE</b> <var>file_spec</var>
        </code>
        <p>
            Overlays the lines of a program from an ASCII program file into the existing program. The loaded
            lines overwrite existing lines if they have the same line number.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is a string expression indicating
                the device and file to read the program from. See the <a href="#OPEN">OPEN</a>
                statement for valid file specifications. Refer to
                the section on <a href="#eightpointthree">file names on disk</a>
                for information on how this statement matches filenames on a disk
                device.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> cannot be found: <samp>File not found</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                <code><var>file_spec</var></code> was not saved as ASCII: <samp>Bad file mode</samp>.
            </li>
            <li>
                A loaded ASCII file contains lines without line numbers:
                <samp>Direct statement in file</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="MID$"><code>MID$</code> function</h4>
        <code class="block">
            <var>substring</var> <b>= MID$(</b><var>string</var><b>,</b> <var>position</var> [<b>,</b> <var>length</var>]<b>)</b>
        </code>
        <p>
            Returns a substring of <code><var>string</var></code> starting at <code><var>position</var></code>, counting from 1. The
            substring has length <code><var>length</var></code> if specified, defaulting to 1.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string</var></code> is a string expression.
            </li>
            <li>
                <code><var>position</var></code> is a numeric expression between 1 and the string length, inclusive.
            </li>
            <li>
                <code><var>length</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string</var></code> has a number value or <code><var>position</var></code> or <code><var>length</var></code> have string values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>position</var></code> or <code><var>length</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>position</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>length</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="MID$-statement"><code>MID$</code> statement</h4>
        <code class="block">
            <b>MID$(</b><var>string_name</var><b>,</b> <var>position</var> [<b>,</b> <var>length</var>]<b>) =</b> <var>substring</var>
        </code>
        <p>
            Replaces part of <code><var>string_name</var></code> with <code><var>substring</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is a valid string variable name.
            </li>
            <li>
                <code><var>position</var></code> is a numeric expression between 1 and the string length, inclusive.
            </li>
            <li>
                <code><var>length</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                No whitespace is allowed between <code>MID$</code> and <code>(</code>.
            </li>
            <li>
                If <code><var>substring</var></code> is longer than <code><var>length</var></code>, only the first <code><var>length</var></code> characters
                are used.
            </li>
            <li>
                If <code><var>substring</var></code> is shorter than <code><var>length</var></code>, only <code>LEN(<var>substring</var>)</code> characters
                are replaced.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>position</var></code> is greater than the length of <code><var>string_name</var></code>:
                <samp>Illegal function call</samp>, except if <code><var>length</var></code> is specified as 0.
            </li>
            <li>
                <code><var>position</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>length</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>position</var></code> or <code><var>length</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="MKDIR"><code>MKDIR</code> statement</h4>
        <code class="block">
            <b>MKDIR</b> <var>path</var>
        </code>
        <p>
            Creates a new directory on a disk device.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>path</var></code> is a string expression that specifies the
                path of the new directory. The path may optionally be preceded by the
                name of the disk device; if the device name is omitted, a directory is
                created on the current disk device.
                <code><var>path</var></code> will be truncated into
                <a href="#eightpointthree">all-uppercase 8.3 format</a>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>path</var></code> is not a string: <samp>Type mismatch</samp>.
            </li>
            <li>
                The parent directory of <code><var>path</var></code> does not exist: <samp>Path not found</samp>.
            </li>
            <li>
                The pathname already exists: <samp>Path/File access error</samp>.
            </li>
            <li>
                The user has no write permission: <samp>Permission denied</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="MKD$"><code>MKD$</code> function</h4>
        <code class="block">
            <var>bytes</var> <b>= MKD$(</b><var>double</var><b>)</b>
        </code>
        <p>
            Returns the internal 8-byte Microsoft Binary Format representation of a double-
            precision number.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>double</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="MKI$"><code>MKI$</code> function</h4>
        <code class="block">
            <var>bytes</var> <b>= MKI$(</b><var>int</var><b>)</b>
        </code>
        <p>
            Returns the internal 2-byte little-endian representation of an integer.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>int</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>int</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="MKS$"><code>MKS$</code> function</h4>
        <code class="block">
            <var>bytes</var> <b>= MKS$(</b><var>single</var><b>)</b>
        </code>
        <p>
            Returns the internal 8-byte Microsoft Binary Format representation of a single-
            precision number.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>single</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="MOTOR"><code>MOTOR</code> statement</h4>
        <code class="block">
            <b>MOTOR</b> [<var>num</var>]
        </code>
        <p>
            Does nothing.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>num</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, this statement turns on the cassette motor if <code><var>num</var></code>
                is nonzero or omitted, and turns it off if <code><var>num</var></code>
                is zero. This is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="NAME"><code>NAME</code> statement</h4>
        <code class="block">
            <b>NAME</b> <var>old_name</var> <b>AS</b> <var>new_name</var>
        </code>
        <p>
            Renames the disk file <code><var>old_name</var></code> into <code><var>new_name</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>old_name</var></code> and <code><var>new_name</var></code>
                are string expressions giving the path on disk to the old and new filenames,
                respectively.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
               <code><var>new_name</var></code> will be modified into <a href="#eightpointthree">all-uppercase 8.3 format</a>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>old_name</var></code> or <code><var>new_name</var></code> have number values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>old_name</var></code> does not exist: <samp>File not found</samp>.
            </li>
            <li>
                <code><var>old_name</var></code> is open: <samp>File already open</samp>.
            </li>
            <li>
                <code><var>new_name</var></code> exists: <samp>File already exists</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="NEW"><code>NEW</code> statement</h4>
        <code class="block">
            <b>NEW</b>
        </code>
        <p>
            Stops execution of a program, deletes the program in memory, executes
            <code><a href="#CLEAR">CLEAR</a></code> and <code><a href="#RESTORE">RESTORE</a></code>
            and returns control to the user.
        </p>
    </section>
<hr>

    <section>
        <h4 id="NEXT"><code>NEXT</code> statement</h4>
        <code class="block">
            <b>NEXT</b> [<var>var_0</var> [<b>,</b> <var>var_1</var>] ...]
        </code>
        <p>
            Iterates a <code>FOR&#8212;NEXT</code> loop: increments the loop variable and
            jumps to the <code><a href="#FOR">FOR</a></code>
            statement. If no variables are specified, next matches the most recent <code>FOR</code>
            statement. Several nested <code>NEXT</code> statements can be consolidated into one by
            using the variable list. If one or more variables are specified, their order
            must match the order of earlier <code>FOR</code> statements.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are numeric variables which are loop counters in a <code>FOR</code> statement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No <code>FOR</code> statement is found to match the <code>NEXT</code> statement and variables:
                <samp>NEXT without FOR</samp>.
            </li>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are string variables: <samp>NEXT without FOR</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="NOISE"><code>NOISE</code> statement</h4>
        <code class="block">
            <b>NOISE</b> <var>source</var><b>,</b> <var>volume</var><b>,</b> <var>duration</var>
        </code>
        <p>
            Generates various kinds of noise.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>source</var></code> is a numeric expression in  <code>[0&#8212;7]</code>.
                It indicates the type of noise:
                <div class="scrollable">
                    <table>
                        <tr>
                            <th>source</th>
                            <th>type</th>
                            <th>top of frequency band (Hz)</th>
                        </tr>
                        <tr>
                            <td>0</td>
                            <td>periodic</td>
                            <td>6991</td>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>periodic</td>
                            <td>3495</td>
                        </tr>
                        <tr>
                            <td>2</td>
                            <td>periodic</td>
                            <td>1747</td>
                        </tr>
                        <tr>
                            <td>3</td>
                            <td>periodic</td>
                            <td>last tone played on voice 2</td>
                        </tr>
                        <tr>
                            <td>0</td>
                            <td>white noise</td>
                            <td>6991</td>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>white noise</td>
                            <td>3495</td>
                        </tr><tr>
                            <td>2</td>
                            <td>white noise</td>
                            <td>1747</td>
                        </tr><tr>
                            <td>3</td>
                            <td>white noise</td>
                            <td>last tone played on voice 2</td>
                        </tr>
                    </table>
                </div>
            </li>
            <li>
                <code><var>volume</var></code> is a numeric expression in <code>[0&#8212;15]</code>.
            </li>
            <li>
                <code><var>duration</var></code> is a numeric expression.
            </li>
        </ul>
        <p>
            Volume and duration are determined in the same way as for the
            <code><a href="#SOUND">SOUND</a></code> statement; see there.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This statement is only available if
                <code><a href="#--syntax">--syntax</a>={pcjr|tandy}</code> is set.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code>SOUND ON</code> has not been executed: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>duration</var></code> is not in <code>[-65535&#8212;65535]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>volume</var></code> is not in <code>[0&#8212;15]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>source</var></code> is not in <code>[0&#8212;7]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="OCT$"><code>OCT$</code> function</h4>
        <code class="block">
            <var>octal</var> <b>= OCT$(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns a string with the octal representation of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a
                numeric expression in <code>[-32768&#8212;65535]</code>. Values for
                negative <code><var>x</var></code> are shown as two's-complement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ON-jump"><code>ON</code> statement (calculated jump)</h4>
        <code class="block">
            <b>ON</b> <var>n</var> {<b>GOTO</b>|<b>GOSUB</b>} <var>line_number_0</var> [<b>,</b> <var>line_number_1</var>] ...
        </code>
        <p>
            Jumps to the <code><var>n</var></code>th line number specified in the list. If <code><var>n</var></code> is 0 or greater
            than the number of line numbers in the list, no jump is performed. If <code>GOTO</code> is specified,
            the jump is unconditional; if <code>GOSUB</code> is specified, jumps to a subroutine.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>n</var></code> is a numeric expression in <code>[0&#8212;255]</code>. The expression must not start with the <code>STRIG</code>, <code>PEN</code>, <code>PLAY</code> or <code>TIMER</code> function keywords; if you need these functions, the expression must be bracketed.
            </li>
            <li>
                <code><var>line_number_0</var>, <var>line_number_1</var>, ...</code> are existing line numbers in the program.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>n</var></code> is not in <code>[-32768&#8212;32767]</code>, <samp>Overflow</samp> .
            </li>
            <li>
                <code><var>n</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                The line number jumped to does not exist: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ON-event"><code>ON</code> statement (event trapping)</h4>
        <code class="block">
            <b>ON</b> {<b>COM(</b><var>n</var><b>)</b>|<b>KEY(</b><var>n</var><b>)</b>|<b>STRIG(</b><var>n</var><b>)</b>|<b>PEN</b>|<b>PLAY(</b><var>n</var><b>)</b>|<b>TIMER(</b><var>x</var><b>)</b>}
            <b>GOSUB</b> <var>line_number</var>
        </code>
        <p>
            Defines an event trapping subroutine.
            The type of event is given by one of the following keywords:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>COM(<var>n</var>)</code></td>
                    <td>
                        The event is triggered
                        if data is present in the input buffer of the
                        <code>COM<var>n</var>:</code>. <code><var>n</var></code>
                        is the port number in <code>[1,2]</code>.
                    </td>
                </tr>
                <tr>
                    <td><code>KEY(<var>n</var>)</code></td>
                    <td>
                        The event is triggered if key <code><var>n</var></code> is pressed.
                        <code><var>n</var></code> is the key number <code>[1&#8212;10]</code>
                        defined in the <code><a href="#KEY-event-def">KEY</a></code> statement.
                    </td>
                </tr>
                <tr>
                    <td><code>STRIG(<var>n</var>)</code></td>
                    <td>
                        They event is triggered if fire button <code><var>n</var></code> is pressed.
                        <code><var>n</var></code> in <code>[0,2,4,6]</code> refer to the
                        two fire triggers on two joysticks.
                    </td>
                </tr>
                <tr>
                    <td><code>PEN</code></td>
                    <td>
                        The event is triggered if the light pen is on the
                        screen. (In PC-BASIC, the light pen is emulated by default by the
                        right mouse button).
                    </td>
                </tr>
                <tr>
                    <td><code>PLAY(<var>n</var>)</code></td>
                    <td>
                        The event is triggered if there are exactly <code><var>n</var></code> notes left on the
                        music background queue. <code><var>n</var></code> is a numeric expression in <code>[1&#8212;32]</code>.
                    </td>
                </tr>
                <tr>
                    <td><code>TIMER(<var>x</var>)</code></td>
                    <td>
                        The event is triggered every <code><var>x</var></code> seconds after the <code><a href="#TIMER">TIMER ON</a></code>
                        statement. <code><var>x</var></code> is a numeric expression in <code>[1&#8212;86400]</code>.
                    </td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul>
            <li>
                Event trapping for your chosen event first needs to be enabled using one of the
                statements: <code><a href="#COM">COM(<var>n</var>) ON</a></code>,
                <code><a href="#KEY-event">KEY(<var>n</var>) ON</a></code>,
                <code><a href="#STRIG-events">STRIG(<var>n</var>) ON</a></code>,
                <code><a href="#PEN-statement">PEN ON</a></code>,
                <code><a href="#PLAY-event">PLAY ON</a></code>,
                <code><a href="#TIMER-event">TIMER ON</a></code>
            </li>
            <li>
                Events are only trapped when a program is running.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> or <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>n</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>n</var></code> or <code><var>x</var></code> is outside the specified range: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="ON-ERROR"><code>ON ERROR</code> statement</h4>
        <code class="block">
            <b>ON ERROR GOTO</b> {<var>line_number</var>|<b>0</b>}
        </code>
        <p>
            Turns error trapping on or off. When <code><var>line_number</var></code> is set, any error causes the error handling
            routine starting at that line number to be called; no message is printed and program execution is not stopped. The
            error handling routine is ended by a <code><a href="#RESUME">RESUME</a></code> statement.
            While in an error handling routine, events are paused and error trapping is
            disabled. After the <code>RESUME</code> statement, any triggered events are picked up in the following
            order: <code>KEY</code>, <code>TIMER</code>, <code>PLAY</code> - the order of the others is unknown.
            Unlike event trapping, error trapping remains active when no program is running.
            <code>ON ERROR GOTO 0</code> turns off error trapping.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is an existing line number in the program.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                It is not possible to start the error handler at line number <code>0</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> does not exist: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="OPEN"><code>OPEN</code> statement</h4>
        <code class="block">
            <b>OPEN</b> <var>mode_char</var><b>,</b> [<b>#</b>] <var>file_num</var><b>,</b> <var>file_spec</var> [<b>,</b> <var>rec_len</var>]
        </code>
        <code class="block">
            <b>OPEN</b> <var>file_spec</var> [<b>FOR</b> {<b>INPUT</b>|<b>OUTPUT</b>|<b>APPEND</b>|<b>RANDOM</b>}]
                       [<b>ACCESS</b> {<b>READ</b>|<b>WRITE</b>|<b>READ WRITE</b>}]
                       [<b>SHARED</b>|<b>LOCK</b> {<b>READ</b>|<b>WRITE</b>|<b>READ WRITE</b>}]
                       <b>AS</b> [<b>#</b>] <var>file_num</var> [<b>LEN =</b> <var>rec_len</var>]
        </code>
        <p>
            Opens a data file on a device.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is a string expression.
                See below for the form of valid file specifications.
            </li>
            <li>
                <code><var>file_num</var></code> is a numeric expression in <code>[1&#8212;3]</code>.
            </li>
            <li>
                <code><var>rec_len</var></code> is a numeric expression in <code>[1&#8212;128]</code>: the record length.
            </li>
            <li>
                <code><var>mode_char</var></code> is a string expression of which the first character is
                one of <code>["I", "O", "A", "R"]</code>.
            </li>
        </ul>
        <h5>Access modes</h5>
        <p>
            The <code>FOR</code> modes or <code><var>mode_char</var></code> are as follows:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>mode_char</var></code></th>
                    <th><code>FOR</code></th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>"I"</code></td>
                    <td><code>INPUT</code></td>
                    <td>
                        Opens a text file for reading and positions the file pointer at the
                        start.
                    </td>
                </tr>
                <tr>
                    <td><code>"O"</code></td>
                    <td><code>OUTPUT</code></td>
                <td>
                    Truncates a text file at the start and opens it for writing. Any
                    data previously present in the file will be deleted.
                </td>
                </tr>
                <tr>
                    <td><code>"A"</code></td>
                    <td><code>APPEND</code></td>
                    <td>Opens a text file for writing at the end of any existing data.</td>
                </tr>
                <tr>
                    <td><code>"R"</code></td>
                    <td><code>RANDOM</code></td>
                    <td>
                        Opens a file for random access; the file is divided in records of
                        length <code><var>rec_len</var></code>. If <code>LEN</code> is not specified, the record length defaults to
                        128. The file contents can be accessed using <code><a href="#GET-files">GET</a></code>
                        and <code><a href="#PUT-files">PUT</a></code> of the <code><a href="#FIELD">FIELD</a></code>
                        buffer; the <code>FIELD</code> buffer can be accessed through <code>FIELD</code> variables or through
                        <code><a href="#PRINT">PRINT#</a></code> and <code><a href="#INPUT-file">INPUT#</a></code> statements.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            If no <code>FOR</code> mode or <code><var>mode_char</var></code> is specified, the file is opened for <code>RANDOM</code>.
        </p>
        <p>
            If both <code>FOR</code> and <code>ACCESS</code> are specified, any <code>ACCESS</code> mode is allowed for
            <code>RANDOM</code> but for the other modes the access must match as follows:
        </p>
        <div class="scrollable">
        <table>
            <tr>
                <th><code>FOR</code></th>
                <th>default <code>ACCESS</code></th>
                <th>allowed <code>ACCESS</code></th>
            </tr>
            <tr>
                <td><code>INPUT</code></td>
                <td><code>READ</code></td>
                <td><code>READ</code></td>
            </tr>
            <tr>
                <td><code>OUTPUT</code></td>
                <td><code>WRITE</code></td>
                <td><code>WRITE</code></td>
            </tr>
            <tr>
                <td><code>APPEND</code></td>
                <td><code>READ WRITE</code></td>
                <td><code>READ WRITE</code></td>
            </tr>
            <tr>
                <td><code>RANDOM</code></td>
                <td><code>READ WRITE</code></td>
                <td>all</td>
            </tr>
        </table>
        </div>
        <h5>Sharing and locks</h5>
        <p>
            If neither <code>SHARED</code> nor <code>LOCK</code> are specified. Inside this process, a file may be opened multiple
            times for <code>INPUT</code> or <code>RANDOM</code> but only once for <code>OUTPUT</code> or <code>APPEND</code>, as long as it
            is again opened in default mode. It may not be opened in <code>SHARED</code> or any <code>LOCK</code>
            modes.
        </p>
        <p>
            If <code>SHARED</code>, <code>LOCK READ</code>, <code>LOCK WRITE</code> or <code>LOCK READ WRITE</code> is specified, whether
            two <code>OPEN</code> statements may access the same file depends on one's <code>LOCK</code> status
            and the other's <code>ACCESS</code> status and vice versa.
            For two <code>OPEN</code> statements as follows:
            <code class="block">
                <b>OPEN "file"</b> <var>lock_1</var> <b>AS 1</b>
                <br>
                <b>OPEN "file" ACCESS</b> <var>acc_2</var> <b>AS 2</b>
            </code>
            the following combinations are allowed:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th rowspan="2" colspan="2">Access allowed</th>
                    <th colspan="3"><code><var>acc_2</var></code></th>
                </tr><tr>
                    <th><code>READ</code></th>
                    <th><code>WRITE</code></th>
                    <th><code>READ WRITE</code></th>
                </tr><tr>
                    <th rowspan="4"><code><var>lock_1</var></code></th>
                    <th><code>SHARED</code></th>
                    <td>yes</td>
                    <td>yes</td>
                    <td>yes</td>
                </tr><tr>
                    <th><code>LOCK READ</code></th>
                    <td>no</td>
                    <td>yes</td>
                    <td>no</td>
                </tr><tr>
                    <th><code>LOCK WRITE</code></th>
                    <td>yes</td>
                    <td>no</td>
                    <td>no</td>
                </tr><tr>
                    <th><code>LOCK READ WRITE</code></th>
                    <td>no</td>
                    <td>no</td>
                    <td>no</td>
                </tr>
            </table>
        </div>
        <p>
            In GW-BASIC under MS-DOS with <code>SHARE.EXE</code> active, these locks should be enforced
            across a network as well as inside a single BASIC process. Without
            <code>SHARED</code> and <code>LOCK</code>, the file is locked exclusively
            for use by the GW-BASIC process. By contrast, in PC-BASIC,
            the locks are only implemented internally. Whether other processes may access
            the file will depend on the host OS.
        </p>
        <h5>File specifications</h5>
        <p>
            <code><var>file_spec</var></code> is a string expression of the form
            <code><b>"</b><var>device</var><b>:</b><var>parameters</var><b>"</b></code>,
            where <code><var>device</var></code> is a PC-BASIC <a href="#devices">device</a>
            and the form of the <code><var>parameters</var></code> is specific to
            the type of device:
        </p>
        <dl>
            <dt>
                Disk devices <code>A:</code>&#8212;<code>Z:</code> and <code>@:</code>
            </dt>
            <dd>
                <code><var>parameters</var></code> must specify a valid file path on the disk.
                See <a href="#eightpointthree">MS-DOS 8.3 filenames</a> for interpretation of path specifications.
            </dd>
            <dt>
                Cassette device <code>CAS1:<code>
            </code></code></dt>
            <dd>
                <code><var>parameters</var></code> can be a file name of up to eight characters.
                Cassette file names are case sensitive, have no path or extension,
                may be empty and do not need to be unique. They may contain any
                character in the range <code>&amp;H20</code>&#8211;<code>&amp;HFF</code>.
                On the cassette device, when called in interactive mode,
                <code><a href="#OPEN">OPEN</a></code>,
                <code><a href="#MERGE">MERGE</a></code>,
                <code><a href="#LOAD">LOAD</a></code>
                and <code><a href="#BLOAD">BLOAD</a></code> will print a message to the console
                for each file found while winding the tape. The message consists
                of the filename followed by a dot and the
                file type and concluded with a status message. The file type is one of
                the following:
                <dl class="compact">
                    <dt><samp>A</samp></dt>
                    <dd>Program file in text format</dd>
                    <dt><samp>B</samp></dt>
                    <dd>Program file in bytecode format</dd>
                    <dt><samp>D</samp></dt>
                    <dd>Data file</dd>
                    <dt><samp>M</samp>
                    </dt><dd><code><a href="#BSAVE">BSAVE</a></code> memory image</dd>
                    <dt><samp>P</samp></dt>
                    <dd>Program file in protected format</dd>
                </dl>
                If the file does not match the file specification and required file type,
                the status is <samp>Skipped</samp>; if the file matches, the status is
                <samp>Found</samp>. When called from a program, these statements do
                not print messages to the console.
            </dd>
            <dt>
                Console and parallel devices <code>SCRN:</code>, <code>KYBD:</code>, and <code>LPT<var>n</var>:</code>
            </dt>
            <dd>
                These devices do not allow futher device parameters.
            </dd>
            <dt>
                Serial devices <code>COM<var>n</var>:<code>
            </code></code></dt>
            <dd>
                <p>
                    When opening a <code>COM</code> port, the <code><var>file_spec</var></code> has the form
                    <code class="block"><b>"COM</b><var>n</var><b>:</b>[<var>speed</var>[<b>,</b><var>parity</var>[<b>,</b><var>data</var>[<b>,</b><var>stop</var>[<b>,RS</b>][<b>,CS</b>[<var>n</var>]][<b>,DS</b>[<var>n</var>]][<b>,CD</b>[<var>n</var>]][<b>,LF</b>][<b>,PE</b>]]]]]<b>"</b></code>
                    The first four parameters after the device colon must be given
                    in the order specified but the named parameters
                    can be given in any order.
                    The meaning of the parameters is:
                </p>
                <div class="scrollable">
                    <table>
                        <tr>
                            <th>Parameter</th>
                            <th>Default</th>
                            <th>Meaning</th>
                        </tr>
                        <tr>
                            <td><code><var>speed</var></code></td>
                            <td><code>300</code></td>
                            <td>
                                Baud (bps) rate for the connection. <code><var>speed</var></code> is one of
                                <code>[75, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600]</code>.
                            </td>
                        </tr>
                        <tr>
                            <td><code><var>parity</var></code></td>
                            <td><code>E</code></td>
                            <td>
                                Parity bit convention. <code><var>parity</var></code> is one of <code>[S, M, O, E, N]</code>.
                                <table>
                                    <tr>
                                        <th><code><var>parity</var></code></th>
                                        <th>Meaning</th>
                                        <th>Effect</th>
                                    </tr>
                                    <tr>
                                        <td><code>S</code></td>
                                        <td>SPACE</td>
                                        <td>Parity bit always set to 0.</td>
                                    </tr>
                                    <tr>
                                        <td><code>M</code></td>
                                        <td>MARK</td>
                                        <td>Parity bit always set to 1.</td>
                                    </tr>
                                    <tr>
                                        <td><code>O</code></td>
                                        <td>ODD</td>
                                        <td>Parity bit set so that character parity is odd.</td>
                                    </tr>
                                    <tr>
                                        <td><code>E</code></td>
                                        <td>EVEN</td>
                                        <td>Parity bit set so that character parity is even.</td>
                                    </tr>
                                    <tr>
                                        <td><code>N</code></td>
                                        <td>NONE</td>
                                        <td>No parity bit transmitted or received.</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td><code><var>data</var></code></td>
                            <td><code>7</code></td>
                            <td>
                                Data bits per byte. <code><var>data</var></code> must be one of <code>[4, 5, 6, 7, 8]</code>.
                                A byte consists of the data bits plus parity bit, if
                                any. Byte size must be in the range <code>[5&#8212;8]</code>:
                                if <code><var>data</var></code> is <code>4</code>,
                                <code><var>parity</var></code> must not be <code>N</code>;
                                if <code><var>data</var></code> is <code>8</code>,
                                <code><var>parity</var></code> must be <code>N</code>.
                            </td>
                        </tr>
                        <tr>
                            <td><code><var>stop</var></code></td>
                            <td><code>1</code></td>
                            <td>
                                The number of stop bits. <code><var>stop</var></code> must be <code>1</code> or <code>2</code>.
                                Default is <code>2</code> if <code><var>speed</var></code> is <code>75</code> or <code>110</code>; <code>1</code> otherwise.
                            </td>
                        </tr>
                        <tr>
                            <td><code>RS</code></td>
                            <td>no</td>
                            <td>Suppress <i>Request To Send</i>.</td>
                        </tr>
                        <tr>
                            <td><code>CS[<var>n</var>]</code></td>
                            <td><code>CS1000</code></td>
                            <td>
                                Set <i>Clear To Send</i> timeout to <code><var>n</var></code> milliseconds.
                                If <code><var>n</var></code> is <code>0</code> or not given, disable CTS check.
                                Default is <code>CS0</code> if <code>RS</code> is set; <code>CS1000</code> otherwise.
                            </td>
                        </tr>
                        <tr>
                            <td><code>DS[<var>n</var>]</code></td>
                            <td><code>DS1000</code></td>
                            <td>
                                Set <i>Data Set Ready</i> timeout to <code><var>n</var></code> milliseconds.
                                If <code><var>n</var></code> is <code>0</code> or not given, disable DSR check.
                            </td>
                        </tr>
                        <tr>
                            <td><code>CD[<var>n</var>]</code></td>
                            <td><code>CD0</code></td>
                            <td>
                                Set <i>Carrier Detect</i> timeout to <code><var>n</var></code> milliseconds.
                                If <code><var>n</var></code> is <code>0</code> or not given, disable CD check.
                            </td>
                        </tr>
                        <tr>
                            <td><code>LF</code></td>
                            <td>no</td>
                            <td>Send a line feed after each carriage return.</td>
                        </tr>
                        <tr>
                            <td><code>PE</code></td>
                            <td>no</td>
                            <td>Enable parity checking (This setting is ignored by PC-BASIC).</td>
                        </tr>
                    </table>
                </div>
            </dd>

        </dl>

        <h5>Notes</h5>
        <ul>
            <li>
                If a <code>COM</code> port is opened for <code>RANDOM</code>, access is
                byte-for-byte rather than through <code>FIELD</code> records; <code>PRINT#</code> and <code>INPUT#</code> access
                the port directly. <code><var>rec_len</var></code> sets the number of bytes read by the <code>GET</code> and
                <code>PUT</code> statements.
            </li>
            <li>
                For <code>INPUT</code>, <code>OUTPUT</code> and <code>APPEND</code> modes, <code>LEN</code> may be specified but is ignored.
            </li>
            <li>
                If I/O is attempted contravening the <code>FOR</code> mode specified,
                the <code><a href="#PRINT">PRINT</a></code> or
                <code><a href="#INPUT-file">INPUT</a></code>
                statement will raise <samp>Bad file mode</samp>.
            </li>
            <li>
                If <code>RANDOM</code> I/O is attempted contravening the <code>ACCESS</code> mode specified, the
                <code>PUT</code> or <code>GET</code> statement will raise <samp>Path/File access error</samp>.
            </li>
            <li>
                The <code>#</code> is optional and has no effect.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is empty or a non-existent device: <samp>Bad file number</samp>.
            </li>
            <li>
                <code>FOR APPEND ACCESS WRITE</code> is specified: <samp>Path/File access error</samp>.
            </li>
            <li>
                <code>FOR</code> and <code>ACCESS</code> mismatch in other ways: <samp>Syntax error</samp>.
            </li>
            <li>
                The <code>COM:</code> <code><var>file_spec</var></code> parameters do not follow the specification:
                <samp>Bad file name</samp>.
            </li>
            <li>
                The <code>CAS1:</code> <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp>.
            </li>
            <li>
                A file is already open for <code>OUTPUT</code> or <code>APPEND</code>: <samp>File already open</samp>.
                This is only raised for <code>COMn:</code>, <code>CASn:</code> and disk devices.
            </li>
            <li>
                <code><var>rec_len</var></code> or <code><var>file_num</var></code> have string values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> or <code><var>mode_char</var></code> have number values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[1&#8212;3]</code>: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>rec_len</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
            <code>
                <var>rec_len</var></code> is not in <code>[1&#8212;128]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>mode_char</var></code> is empty or the first character is not in
                <code>["I", "O", "A", "R"]</code>: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="OPTION-BASE"><code>OPTION BASE</code> statement</h4>
        <code class="block">
            <b>OPTION BASE</b> <var>n</var>
        </code>
        <p>
            Sets the starting index of all arrays to <code><var>n</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>n</var></code> is a literal digit  <code>0</code> or <code>1</code>. Expressions are not allowed.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code>OPTION BASE</code> has not been called,
                the first array allocation defaults to starting index 0.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> is not a digit <code>0</code> or <code>1</code>: <samp>Syntax error</samp>.
            </li>
            <li>
                <code>OPTION BASE 1</code> is called but an array has already been allocated before: <samp>Duplicate definition</samp>.
            </li>
            <li>
                <code>OPTION BASE</code> is called more than once with different starting index:
                <samp>Duplicate definition</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="OUT"><code>OUT</code> statement</h4>
        <code class="block">
            <b>OUT</b> <var>port</var><b>,</b> <var>value</var>
        </code>
        <p>
            Sends a byte to an emulated machine port.
        </p>
        <p>
            The following machine ports are emulated in PC-BASIC:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>port</var></code></th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>&amp;h201</code></td>
                    <td>resets the game port (joystick port)</td>
                </tr>
                <tr>
                    <td><code>&amp;h3C5</code></td>
                    <td>sets the write bitmask for <code>SCREEN 7</code>, <code>8</code>, <code>9</code> colour planes.
                                <code><var>bitmask</var> = 2 ^ <var>value</var></code>.</td>
                </tr>
                <tr>
                    <td><code>&amp;h3CF</code></td>
                    <td>sets the read colour plane to <code><var>value</var></code>.</td>
                </tr>
                <tr>
                    <td><code>&amp;h3D8</code></td>
                    <td>
                        if <code><var>value</var> = &amp;h1A</code>, enable composite colorburst.<br>
                        if <code><var>value</var> = &amp;h1E</code>, disable composite colorburst.<br>
                        Requires <code><a href="#--video">--video</a>={cga, tandy, pcjr}</code>.
                    </td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul>
            <li>
                Only a limited number of machine ports are emulated.
            </li>
            <li>
                In GW-BASIC under MS-DOS, the sequence needed to set the colour plane mask is:
                <code class="block">
                    OUT &amp;h3C4, 2<br>
                    OUT &amp;h3C5, 2 ^ <var>plane</var>
                </code>
                The sequence needed to set the colour plane is:
                <code class="block">
                    OUT &amp;h3CE, 4<br>
                    OUT &amp;h3CF, <var>plane</var>
                </code>
                The initial <code>OUT</code> statements currently have no effect in PC-BASIC.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>port</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>.
            </li>
            <li>
                <code><var>value</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>port</var></code> or <code><var>value</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>port</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>value</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>value</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PAINT"><code>PAINT</code> statement</h4>
        <code class="block">
            <b>PAINT</b> [<b>STEP</b>] <b>(</b><var>x</var><b>,</b> <var>y</var><b>)</b> [<b>,</b> <var>attrib</var> [<b>,</b> <var>border</var> [<b>,</b> <var>background</var>]]]
        </code>
        <p>
            Flood-fills the screen with a colour or pattern, starting from the given seed point.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code>, <code><var>y</var></code> are numeric expressions in the range <code>[-32768&#8212;32767]</code>
                If STEP is specified, <code><var>x</var></code> <code><var>y</var></code> are offsets
                from the current position. If the seed point is outside the visible screen
                area, no flood fill is performed.
            </li>
            <li>
                <code><var>attrib</var></code> is an expression that specifies the fill attribute or pattern. If not
                specified, the current foreground attribute is used.
            </li>
            <li>
                If <code><var>attrib</var></code> has a number value, it must be in <code>[0&#8212;255]</code>; it specifies the colour
                attribute used to fill.
            </li>
            <li>
                If <code><var>attrib</var></code> has a string value, it specifies a tile pattern (see below).
            </li>
            <li>
                <code><var>border</var></code> is a numeric expression in <code>[0&#8212;255]</code>. It specifies the attribute
                of the fill boundary (see below).
            </li>
            <li>
                <code><var>background</var></code> is a string expression that represents a background tile
                pattern to ignore when determining boundaries (see below).
            </li>
        </ul>
        <h5>Tile patterns</h5>
        <p>
            A tile pattern can be specified by a string of up to 255 characters. The
            interpretation of the string depends on the number of bits per pixel in
            the current screen mode.
        </p>
        <dl>
            <dt>
                1 bit per pixel (e.g. <code>SCREEN 2</code>)
            </dt>
            <dd>Here is an example:
                <pre>
                  76543210    value
                  *.......    CHR$(&amp;h80)
                  .*......    CHR$(&amp;h40)
                  ..*.....    CHR$(&amp;h20)
                  ...*....    CHR$(&amp;h10)
                  ....*...    CHR$(&amp;h08)
                  .....*..    CHR$(&amp;h04)
                  ......*.    CHR$(&amp;h02) </pre>
            </dd>
            <dt>
                <code>SCREEN 7</code>, <code>8</code>, <code>9</code>
            </dt>
            <dd>
                The tile pattern is always 8 pixels wide. The first character in the
                pattern string contains the first bit of each of these 8 pixels, the
                second character contains the second bits, etc.
                For example, in a 2-bits-per-pixel mode, the pattern can have many
                colours. However, the same size pattern as above in attribute &amp;h03 is:
                <pre>
            bit   76543210    value
            0     *.......    CHR$(&amp;h80)
            1     *.......    CHR$(&amp;h80)
            0     .*......    CHR$(&amp;h40)
            1     .*......    CHR$(&amp;h40)
            0     ..*.....    CHR$(&amp;h20)
            1     ..*.....    CHR$(&amp;h20)
            0     ...*....    CHR$(&amp;h10)
            1     ...*....    CHR$(&amp;h10)
            0     ....*...    CHR$(&amp;h08)
            1     ....*...    CHR$(&amp;h08)
            0     .....*..    CHR$(&amp;h04)
            1     .....*..    CHR$(&amp;h04)
            0     ......*.    CHR$(&amp;h02)
            1     ......*.    CHR$(&amp;h02)</pre>
            If the pattern string is truncated before all bits of the last line
            have been defined, the remaining bits will be zero.
            </dd>
            <dt>
                <code>SCREEN 1</code>, <code>3</code>, <code>4</code>, <code>5</code> , <code>6</code>
            </dt>
            <dd>
                Each row of the tile pattern represents a screen row. Colours are
                encoded in consecutive bits &#8212; the more bits per pixel, the narrower the
                pattern is. For 2 bits per pixel, the pattern is 4 pixels wide; for 4
                bits per pixel it is 2 pixels wide. The pattern string above now encodes
                a multicoloured tile:
                <pre>
          3210    76543210    value
          2000    *.......    CHR$(&amp;h80)
          1000    .*......    CHR$(&amp;h40)
          0200    ..*.....    CHR$(&amp;h20)
          0100    ...*....    CHR$(&amp;h10)
          0020    ....*...    CHR$(&amp;h08)
          0010    .....*..    CHR$(&amp;h04)
          0002    ......*.    CHR$(&amp;h02) </pre>
            </dd>
        </dl>
        <p>
            The tile pattern is locked to the screen; imagine a grid starting at
            <code>(0,0)</code> and covering the screen. Whenever an area is tile-filled,
            the tiles are put into this grid. In this way, adjacent areas will have
            continuous tiling even if they were filled from different seed points.
        </p>
        <h5>Boundaries</h5>
        <p>
            A solid flood fill stops at pixels that have the same attribute as the fill
            or that have the specified border attribute, if specified.
            A tiling flood fill stops at the specified border attribute; if no border
            attribute is specified, it stops at the current foreground attribute.
            A tiling flood fill also stops at scan line intervals that are the same as
            the tiling pattern for that line, unless a background pattern is specified
            and the interval also equals the background pattern for that line.</p>
        <h5>Errors</h5>
        <ul>
            <li>
                In <code>SCREEN 7</code>, <code>8</code>, <code>9</code>, if <code><var>background</var></code> equals <code><var>attrib</var></code> up to the length of
                <code><var>attrib</var></code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>background</var></code> has a number value: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>border</var></code>,<code><var>x</var></code>, or <code><var>y</var></code> have a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>border</var></code>,<code><var>x</var></code>, or <code><var>y</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>border</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>attrib</var></code> is numeric and not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>attrib</var></code> is numeric and not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PALETTE"><code>PALETTE</code> statement</h4>
        <code class="block">
            <b>PALETTE</b> [<var>attrib</var><b>,</b> <var>colour</var>]
        </code>
        <p>
            Assigns a colour to an attribute. All pixels with that attribute will change
            colour immediately.
            If no parameters are specified, <code>PALETTE</code> resets to the initial setting.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>attrib</var></code> is a numeric expression between 0 and the current palette
                size, less one.
            </li>
            <li>
                <code><var>colour</var></code> is a numeric expression between -1 and the maximum number of
                colours for the current screen mode, less one. If <code><var>colour</var></code> equals -1,
                the palette remains unchanged.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>attrib</var></code> or <code><var>colour</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>attrib</var></code> or <code><var>colour</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>
            </li>
            <li>
                <code><var>attrib</var></code> or <code><var>colour</var></code> is not in range: <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PALETTE-USING"><code>PALETTE USING</code> statement</h4>
        <code class="block">
            <b>PALETTE USING</b> <var>int_array_name</var> {<b>(</b>|<b>[</b>} <var>start_index</var> {<b>)</b>|<b>]</b>}
        </code>
        <p>
            Assigns new colours to all attributes.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>int_array_name</var></code> is an array of integers (<code>%</code>) that will supply the
                new values for the palette.
            </li>
            <li>
                <code><var>start_index</var></code> is a numeric expression that
                indicates at which index in the array to start mapping to the palette.
            </li>
        </ul>
        <p>
            If an array entry has value <code>-1</code>, the matching attribute is left unchanged.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>int_array_name</var></code> has not been allocated: <samp>Illegal function call</samp>.
                The array will not be automatically allocated.
            </li>
            <li>
            <code><var>int_array_name</var></code> is not an integer array: <samp>Type mismatch</samp>.
            </li>
            <li>
            <code><var>int_array_name</var></code> is too short: <samp>Illegal function call</samp>.
            </li>
            <li>
            <code><var>start_index</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
            <code><var>start_index</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>
            </li>
            <li>
            <code><var>start_index</var></code> is outside array dimensions: <samp>Subscript out of range</samp>
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PCOPY"><code>PCOPY</code> statement</h4>
        <code class="block">
            <b>PCOPY</b> <var>src</var><b>,</b> <var>dst</var>
        </code>
        <p>
            Copies the screen page <code><var>src</var></code> to <code><var>dst</var></code>. All text and graphics on <code><var>dst</var></code> is
            replaced by those of <code><var>src</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>src</var></code> and <code><var>dst</var></code> are numeric expressions between 0 and the current video
                mode's number of pages, less one.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>src</var></code> or <code><var>dst</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>src</var></code> or <code><var>dst</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>src</var></code> or <code><var>dst</var></code> is out of range: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PEEK"><code>PEEK</code> function</h4>
        <code class="block">
            <var>value</var> <b>= PEEK(</b><var>address</var><b>)</b>
        </code>
        <p>
            Returns the value of the memory at  <code><var>segment</var> * 16 + <var>address</var></code> where <code><var>segment</var></code>
            is the current segment set with <code>DEF SEG</code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>address</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>. Negative values are interpreted as their
                two's complement.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
               The memory is only partly emulated in PC-BASIC. See <a href="#memory">Memory model</a> for supported addresses.
               Outside emulated areas, <code>PEEK</code> returns 0.
            </li>
            <li>
               Values for particular memory address can be preset on the command line
                using the <code><a href="#--peek">--peek</a></code> option. This can be used for compatibility with old
                programs. These values will override video or data segment values, if they
                are in those locations.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>address</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>address</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PEN-statement"><code>PEN</code> statement</h4>
        <code class="block"><b>PEN</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}</code>
        <p>
            Controls event trapping and read access of the light pen (emulated through the mouse in PC-BASIC).
            <code>PEN ON</code> switches pen reading and trapping on.  <code>PEN OFF</code> switches it off.
            <code>PEN STOP</code> suspends <code>PEN</code> event trapping until <code>PEN ON</code> is
            executed. Up to one event can be triggered during suspension, provided that
            event handling was switched on prior to suspension. The event triggered during
            suspension is handled immediately after the next <code>PEN ON</code> statement.
        </p>
    </section>
<hr>

    <section>
        <h4 id="PEN"><code>PEN</code> function</h4>
        <code class="block"><var>x</var> <b>= PEN(</b><var>mode</var><b>)</b></code>
        <p>
            Reads the light pen. What this function returns depends on <code><var>mode</var></code>:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>mode</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>Boolean; whether the light pen has been down since last poll.</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>x coordinate of last pen down position</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>y coordinate of last pen down position</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>Boolean; whether the pen is currently down</td>
                </tr>
                <tr>
                    <td>4</td>
                    <td>x coordinate of current pen position</td>
                </tr>
                <tr>
                    <td>5</td>
                    <td>y coordinate of current pen position</td>
                </tr>
                <tr>
                    <td>6</td>
                    <td>character row coordinate of last pen down position</td>
                </tr>
                <tr>
                    <td>7</td>
                    <td>character column coordinate of last pen down position</td>
                </tr>
                <tr>
                    <td>8</td>
                    <td>character row coordinate of current pen position</td>
                </tr>
                <tr>
                    <td>9</td>
                    <td>character column coordinate of current pen position</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mode</var></code> is a numeric expression in <code>[0&#8212;9]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In PC-BASIC, for <i>pen down</i> read <i>mouse button pressed</i>. For <i>pen
                position</i> read <i>mouse pointer position</i>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>mode</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>mode</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>mode</var></code> is not in <code>[0&#8212;9]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PLAY-event"><code>PLAY</code> statement (event-trapping control)</h4>
        <code class="block">
            <b>PLAY</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <ul>
            <li>
                <code>ON</code>: enables <code><a href="#ON-event">ON PLAY</a></code> event
                trapping of the music queue.
            </li>
            <li>
                <code>OFF</code>: disables trapping.
            </li>
            <li>
                <code>STOP</code>: halts trapping until <code>PLAY ON</code> is used.
                Events that occur while trapping is halted will trigger immediately when
                trapping is re-enabled.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PLAY"><code>PLAY</code> statement (music)</h4>
        <code class="block">
            <b>PLAY</b> <var>mml_string_0</var>
        </code>
        <code class="block">
            <b>PLAY</b> [<var>mml_string_0</var>] <b>,</b>  <var>mml_string_1</var>
        </code>
        <code class="block">
            <b>PLAY</b> [<var>mml_string_0</var>] <b>,</b> [<var>mml_string_1</var>] <b>,</b> <var>mml_string_2</var>
        </code>
        <p>
            Plays the tune defined by the Music Macro Language strings <code><var>mml_string_0</var>, ...</code>.
        </p>
        <p>
            Unless <code><a href="#--syntax">--syntax</a>={tandy | pcjr}</code> is set, only the single-voice syntax is available.
            The three separate MML strings correspond to the three voices of the PCjr/Tandy sound adapter.
            The notes in these strings are played synchronously.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mml_string_0</var></code>, <code><var>mml_string_1</var></code>, <code><var>mml_string_2</var></code> are string expressions in MML.
            </li>
            <li>
                At least one MML string must be provided.
            </li>
        </ul>
        <h5>Music Macro Language reference</h5>
        <h6>Notes and Pauses</h6>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Command</th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>{<b>A</b>|<b>B</b>|<b>C</b>|<b>D</b>|<b>E</b>|<b>F</b>|<b>G</b>}[<b>#</b>|<b>+</b>|<b>-</b>][<var>n</var>]</code></td>
                    <td>
                        Play a note. <br>
                        <code>+</code> or <code>#</code> indicates sharp. <br>
                        <code>-</code> indicates flat. <br>
                        <code><var>n</var></code>
                        indicates duration of an <code><var>n</var></code>th note.
                    </td>
                </tr>
                <tr>
                    <td><code><b>N</b><var>n</var></code></td>
                    <td>Play note <code><var>n</var></code>, in the range <code>[0&#8212;84]</code> (7 octaves).<br>
                        <code><var>n</var> = 0</code> means rest.</td>
                </tr>
                <tr>
                    <td><code><b>O</b><var>n</var></code></td>
                    <td>Set the current octave to <code><var>n</var></code>, in the range <code>[0&#8212;6]</code>. Default is 4.</td>
                </tr>
                <tr>
                    <td><code><b>&gt;</b></code></td>
                    <td>Increase the current octave by 1, with a maximum of 6.</td>
                </tr>
                <tr>
                    <td><code><b>&lt;</b></code></td>
                    <td>Decrease the current octave by 1, with a minimum of 0.</td>
                </tr>
                <tr>
                    <td><code><b>P</b><var>n</var></code></td>
                    <td>Pause for the duration of an <code><var>n</var></code>th note.</td>
                </tr>
            </table>
        </div>
        <h6>Timing commands</h6>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Command</th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code><b>.</b></code></td>
                    <td>
                        Increase the duration of the preceding note by 1/2 times its normal
                        duration. Periods can be repeated to increase duration further.</td>
                </tr>
                <tr>
                    <td><code><b>L</b><var>n</var></code></td>
                    <td>Set the duration of following note to an <code><var>n</var></code>th note.
                    (<code><var>n</var>=4</code> is a quarter note, etc.)
                            <code><var>n</var></code> is in the range <code>[1&#8212;64]</code>.</td>
                </tr>
                <tr>
                    <td><code><b>MN</b></code></td>
                    <td>Normal: 7/8 of the duration is sound, with 1/8 silence. Default mode.</td>
                </tr>
                <tr>
                    <td><code><b>ML</b></code></td>
                    <td>Legato: full duration is sound.</td>
                </tr>
                <tr>
                    <td><code><b>MS</b></code></td>
                    <td>Staccato: 3/4 of the duration is sound, with 1/4 silence.</td>
                </tr>
                <tr>
                    <td><code><b>T</b><var>n</var></code></td>
                    <td>Sets the tempo to <code><var>n</var></code> <code>L4</code>s per minute. Default is 120.</td>
                </tr>
            </table>
        </div>
        <h6>Background-mode commands</h6>
        <p>
            These commands affect <code><a href="#SOUND">SOUND</a></code>,
            <code><a href="#PLAY">PLAY</a></code> and <code><a href="#BEEP">BEEP</a></code>
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Command</th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code><b>MB</b></code></td>
                    <td>
                        Turns on background mode; sound commands exit without waiting for the
                        music to finish. The music keeps playing while other commands are
                        executed. There can be up to 16 notes in the background music queue;
                        if more notes are played, <code>PLAY</code> will block until there are only 16 left.
                    </td>
                </tr>
                <tr>
                    <td><code><b>MF</b></code></td>
                    <td>Turns off background mode; sound commands block. Default mode.</td>
                </tr>
            </table>
        </div>
        <h6>Subroutine command</h6>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Command</th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code><b>X</b><var>s</var></code></td>
                    <td>Execute substring. <code><var>s</var></code> is one of the following:
                        <ul>
                            <li>
                                a string variable name followed by a<code>;</code>
                            </li>
                            <li>
                                the result of <code><a href="#VARPTR%24">VARPTR$()</a></code> on a string variable
                            </li>
                        </ul>
                    </td>
                </tr>
            </table>
        </div>
        <h6>Volume control</h6>
        <p>
            Volume control is availabe on <code><a href="#--syntax">--syntax</a>={tandy | pcjr}</code> only:
        </p>
        <div class="scrollable">
        <table>
            <tr>
                <th>Command</th>
                <th>Effect</th>
            </tr>
            <tr>
                <td>
                    <code><b>V</b><var>n</var></code>
                </td>
                <td>
                    Set the volume to <code><var>n</var></code>, in the range <code>[0&#8212;15]</code>.
                    On <code><a href="#--syntax">--suntax</a>=pcjr</code>, if <code><a href="#SOUND-switch">SOUND ON</a></code>
                    has not been executed, this has no effect. On <code><a href="#--syntax">--suntax</a>=tandy</code> it does have.
                </td>
            </tr>
        </table>
        </div>
        <h6>MML Parameters</h6>
        <p>
            Numeric variables <code><var>n</var></code> in the commands above can be:
        </p>
        <ul>
            <li>
                an integer literal, e.g. <code>PLAY "G4"</code>
            </li>
            <li>
                a numeric variable name <code><var>var</var></code> preceded by <code>=</code> and followed by <code>;</code> e.g. <code>PLAY "G=VAR;"</code>
            </li>
            <li>
                the result of <code>VARPTR$(<var>var</var>)</code> preceded by <code>=</code>.  For example, <code>PLAY "G=" + VARPTR$(VAR)</code>
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>mml_string</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>mml_string</var></code> has errors in the MML: <samp>Illegal function call</samp>.
            </li>
            <li>
                A variable in an MML string is of incorrect type: <samp>Type mismatch</samp>.
            </li>
            <li>
                No MML string is specified: <samp>Missing operand</samp>.
            </li>
            <li>
                On PCjr, if <code>SOUND ON</code> has not been executed, using the three-voice syntax
                will raise <samp>Syntax error</samp>. This is not the case on Tandy.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PLAY-function"><code>PLAY</code> function</h4>
        <code class="block">
            <var>length</var> <b>= PLAY(</b><var>voice</var><b>)</b>
        </code>
        <p>
            Returns the number of notes in the background music queue. The return value is in <code>[0&#8212;16]</code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>voice</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
                If <code><a href="#--syntax">--syntax</a>={pcjr|tandy}</code>, indicates for which tone voice channel
                the number of notes is to be returned. If <code><var>voice</var></code> is not in <code>[0&#8212;2]</code>, the
                queue for voice 0 is returned.
                For other choices of <code>--syntax</code>, the <code><var>voice</var></code> value has no effect.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                There are at most 16 notes in the music queue. Some GW-BASIC manuals
                claim there can be up to 32, but in reality <code>PLAY</code> only returns at the
                last 16 notes.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>voice</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>voice</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>voice</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PMAP"><code>PMAP</code> function</h4>
        <code class="block">
            <var>transformed_coord</var> <b>= PMAP(</b><var>original_coord</var><b>,</b> <var>fn</var><b>)</b>
        </code>
        <p>
            Maps between viewport and logical (<code><a href="#WINDOW">WINDOW</a></code>) coordinates.
            If no <code><a href="#VIEW">VIEW</a></code> has been set, the viewport coordinates
            are physical coordinates.
        </p>
        <p>
            Depending on the value of <code><var>fn</var></code>, <code>PMAP</code>
            transforms from logical to viewport coordinates or vice versa:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>fn</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>return viewport x given logical x</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>return viewport y given logical y</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>return logical x given viewport x</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>return logical y given viewport y</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>fn</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Initially, in text mode, <code>PMAP</code> returns 0.
            </li>
            <li>
                In GW-BASIC, <code>PMAP</code> behaves anomalously on <code><a href="#SCREEN-statement">SCREEN</a></code> changes, where it sometimes
                returns results as if the last <code>WINDOW</code> setting had persisted. This behaviour is not
                implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                A physical coordinate is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="POINT-coord"><code>POINT</code> function (current coordinate)</h4>
        <code class="block">
            <var>coord</var> <b>= POINT(</b><var>fn</var><b>)</b>
        </code>
        <p>
            Returns a currently active coordinate of the graphics screen. This is usually
            the last position at which a pixel has been plotted, the second corner given
            in a <code>LINE</code> command, or the centre of the viewport if nothing has been plotted.
            <code><var>fn</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
        </p>
        <p>
            The coordinate returned depends on the value of <code><var>fn</var></code>:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>fn</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>viewport x</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>viewport y</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>logical x</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>logical y</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>fn</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In text mode, returns the active coordinate of any previous graphics mode;
                if no graphics mode has been active, returns 0.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>fn</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="POINT-attr"><code>POINT</code> function (pixel attribute)</h4>
        <code class="block">
            <var>attrib</var> <b>= POINT(</b><var>x</var><b>,</b> <var>y</var><b>)</b>
        </code>
        <p>
            Returns the attribute of the pixel at logical coordinate <code><var>x</var></code>,<code><var>y</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code>, <code><var>y</var></code> are numeric expressions in <code>[-32768&#8212;32767]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>x</var></code>,<code><var>y</var></code> is outside the screen, returns -1.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Function is called in text mode: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>x</var></code> or <code><var>y</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> or <code><var>y</var></code> or the physical coordinates they translate into are not in
                <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="POKE"><code>POKE</code> statement</h4>
        <code class="block">
            <b>POKE</b> <var>address</var><b>,</b> <var>value</var>
        </code>
        <p>
            Sets the value of the memory byte at
            <code><var>segment</var> * 16 + <var>address</var></code> to <code><var>value</var></code>,
            where <code><var>segment</var></code> is the current segment set with
            <code><a href="#DEF-SEG">DEF SEG</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>address</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>. Negative values are
                interpreted as their two's complement.
            </li>
            <li>
                <code><var>value</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The memory is only partly emulated in PC-BASIC. See <a href="#memory">Memory model</a> for supported addresses.
                Outside emulated areas of memory, this statement has no effect.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>address</var></code> or <code><var>value</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>address</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>value</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>value</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="POS"><code>POS</code> function</h4>
        <code class="block">
            <var>pos</var> <b>= POS(</b><var>dummy</var><b>)</b>
        </code>
        <p>
            Returns the current cursor column position, in the range <code>[1&#8212;80]</code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>dummy</var></code> is a valid expression of any type; its value has no effect.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PSET"><code>PSET</code> and <code>PRESET</code> statements</h4>
        <code class="block">
            { <b>PSET</b> | <b>PRESET</b> } [<b>STEP</b>] <b>(</b><var>x</var><b>,</b> <var>y</var><b>)</b> [<b>,</b> <var>attrib</var>]
        </code>
        <p>
            Change the attribute of a pixel on the screen at position <code>(<var>x</var>, <var>y</var>)</code>.
            If <code>STEP</code> is specified, <code>(<var>x</var>, <var>y</var>)</code> is an offset from the current position.
        </p>
        <p>
            If <code><var>attrib</var></code> is between 0 and the screen mode's palette size, the pixel is changed to
            attribute <code><var>attrib</var></code>. If <code><var>attrib</var></code> is larger than the palette size, the pixel's
            attribute is changed to the highest legal attribute value.
            If <code><var>attrib</var></code> is not specified, <code>PSET</code> changes the attribute to the current
            foreground attribute while <code>PRESET</code> changes it to zero.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code>, <code><var>y</var></code> are numeric expressions in <code>[-32768&#8212;32767]</code>.
            </li>
            <li>
                <code><var>attrib</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> or <code><var>y</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>attrib</var></code>, <code><var>x</var></code> or <code><var>y</var></code> or the physical coordinates they translate into are not in
                <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>attrib</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PRINT"><code>PRINT</code> and <code>LPRINT</code> statements</h4>
        <code class="block">
            {<b>LPRINT</b>|{<b>PRINT</b>|<b>?</b>} [<b>#</b> <var>file_num</var><b>,</b>]} [<var>expr_0</var>|<b>;</b>|<b>,</b>|<b>SPC(</b><var>n</var><b>)</b>|<b>TAB(</b><var>n</var><b>)</b>] ...
            [<b>USING</b> <var>format</var><b>;</b> <var>uexpr_0</var> [{<b>;</b>|<b>,</b>} <var>uexpr_1</var>] ... [<b>;</b>|<b>,</b>]]
        </code>
        <p>
            Writes expressions to the screen, printer, file or device. If <code>LPRINT</code> is used,
            output goes to <code>LPT1:</code>. If <code><var>file_num</var></code> is specified, output goes to the file or
            device open under that number. <code>?</code> is a shorthand for <code>PRINT</code> and has the same
            effect.
        </p>
        <p>
            Expressions can optionally be separated by one or more of the following tokens:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>;</code></td>
                    <td>
                        Attaches two expressions tight together; strings will be
                        printed without any space in between, numbers will have one space
                        separating them, in addition to the space or minus sign that indicate
                        the sign of the number.
                    </td>
                </tr>
                <tr>
                    <td><code>,</code></td>
                    <td>
                        The expression after will be positioned at the next available
                        zone. The output file is divided in 14-character zones; if the width of the
                        file is not a multiple of 14, the remaining spaces are unused and the first
                        zone of the next line is used instead. If the file has a width of less
                        than 14 characters, the zones are determined as if the file were wrapping
                        continuously.
                    </td>
                </tr>
                <tr>
                    <td><code>SPC(<var>n</var>)</code></td>
                    <td>
                        Produces <code><var>n</var></code> spaces, where <code><var>n</var></code> is a numeric
                        expression. if <code><var>n</var></code> is less than zero, it defaults to zero. If <code><var>n</var></code> is
                        greater than the file width, it is taken modulo the file width.
                    </td>
                </tr>
                <tr>
                    <td><code>TAB(<var>n</var>)</code></td>
                    <td>
                        Moves to column <code><var>n</var></code>, where <code><var>n</var></code> is a numeric
                        expression. if <code><var>n</var></code> is less than zero, it defaults to zero. If <code><var>n</var></code> is
                        greater than the file width, it is taken modulo the file width. If the
                        current column is greater than <code><var>n</var></code>, TAB moves to column <code><var>n</var></code> on the next
                        line.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            If the print statement does not end in one of these four separation tokens, a newline is
            printed after the last expression.
            String expressions can be separated by one or more spaces, which has the same
            effect as separating by semicolons.
        </p>
        <h5>Format string syntax</h5>
        <p>
            A <code>USING</code> declaration occurs at the end of an <code>[L]PRINT[#]</code> statement and writes a
            formatted string to the screen, printer, file or device. The following tables list the format tokens
            that can be used inside the <code><var>format</var></code> string.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>_</code></td>
                    <td>
                        Escape character; causes the next character in the format string to be
                        printed as is rather than interpreted as a format token.
                    </td>
                </tr>
            </table>
        </div>
        <p>For string expressions:</p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>!</code></td>
                    <td>Prints the first character of a string.</td>
                </tr>
                <tr>
                    <td><code>\\</code></td>
                    <td>
                        Prints 2 or more characters of a string. A greater number of characters is
                        selected by separating the <code>\</code>s by spaces.
                    </td>
                </tr>
                <tr>
                    <td><code>&amp;</code></td>
                    <td>   Prints the whole string.</td>
                </tr>
            </table>
        </div>
        <p>
            For numeric expressions, the format string specifies a width and alignment.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>#</code></td>
                    <td>
                    Indicate a position for a digit.
                    </td>
                </tr>
                <tr>
                    <td><code>.</code></td>
                    <td>
                    Indicate the decimal point.
                    </td>
                </tr>
                <tr>
                    <td><code>,</code></td>
                    <td>
                    Before the decimal point: cause digits to be grouped in threes separated by
                        commas. After the decimal point it is not a token.
                        Provides one digit position.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            The number of characters in the field must not exceed 24.
        </p>
        <p>
            Tokens preceding the number field:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>+</code></td>
                    <td>
                        Cause the sign to be printed for positive as well as negative numbers. The sign is to be printed to the left of the
                        number.
                    </td>
                </tr>
                <tr>
                    <td><code>**</code></td>
                    <td>
                        Cause any leading spaces to be replaced with <code>*</code>s.
                        Provides two digit positions.
                    </td>
                </tr>
                <tr>
                    <td><code>$$</code></td>
                    <td>
                        Cause a <code>$</code> to be printed to the left of the number.
                        Provides one digit position.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            Tokens trailing the number field:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>+</code></td>
                    <td>
                        Cause the sign to be printed for positive as well as negative numbers.
                        The sign will be printed to the right of the number.
                    </td>
                </tr>
                <tr>
                    <td><code>-</code></td>
                    <td>
                        Cause the sign for negative numbers to be printed
                        to the right of the number. Note that <code>-</code> preceding the field is not a token
                        but printed literally.
                    </td>
                </tr>
                <tr>
                    <td><code>^^^^</code></td>
                    <td>Specify that scientific notation <code>E+00</code> is to be used.</td>
                </tr>
            </table>
        </div>
        <p>
            Numeric expressions are always fully printed, even if they do not fit in the
            positions specified. If the number does not fit in the allowed space, a <code>%</code> is
            printed preceding it.
        </p>
        <ul>
            <li>
                If there are more expressions than format fields, the format string is
                wrapped around.
            </li>
            <li>
                Expressions may be separated with semicolons or commas; the effect is the
                same.
            </li>
            <li>
               If the <code>USING</code> declaration ends in a comma or semicolon, no newline is printed at
                the end.
            </li>
            <li>
               After a <code>USING</code> declaration, other elements of the <code>PRINT</code> syntax such as <code>SPC(</code> and <code>TAB(</code> can not
                be used.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>expr_0</var>, <var>expr_1</var>, ...</code> are expressions of any type.
            </li>
            <li>
                <code><var>format</var></code> is a string expression that specifies the output format.
            </li>
            <li>
                <code><var>uexpr_0</var>, <var>uexpr_1</var>, ...</code> are expressions matching a token in the format string.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If an error is raised, the output before the error was encountered is
                printed as normal.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>n</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                The format string contains no tokens: <samp>Illegal function call</samp>.
            </li>
            <li>
                An expression doesn't match the corresponding format token type: <samp>Type mismatch</samp>.
            </li>
            <li>
                A number field in the format string exceeds 24 characters: <samp>Illegal function call</samp>.
            </li>
            <li>
                A number field in the format string contains no <code>#</code> characters: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PUT-files"><code>PUT</code> statement (files)</h4>
        <code class="block">
            <b>PUT</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>record_number</var>]
        </code>
        <p>
            Writes a record to the random-access file <code><var>file_number</var></code> at position
            <code><var>record_number</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression that yields the number
                of an open random-access file. The <code>#</code> is optional and has no effect.
            </li>
            <li>
                <code><var>record_number</var></code> is a numeric expression in <code>[1&#8212;33554432]</code> (<code>2^25</code>) and is interpreted as the record number.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>record_number</var></code> is not in <code>[1&#8212;33554432]</code>: <samp>Bad record number</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is open under a mode other than <code>RANDOM</code>:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not specified: <samp>Missing operand</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PUT-serial"><code>PUT</code> statement (communications)</h4>
        <code class="block">
            <b>PUT</b> [<b>#</b>] <var>com_file_number</var> [<b>,</b> <var>number_bytes</var>]
        </code>
        <p>
            Writes <code><var>number_bytes</var></code> bytes to the communications buffer opened under file
            number <code><var>com_file_number</var></code>. <code><var>number_bytes</var></code> is a numeric expression between 1
            and the <code>COM</code> buffer length, inclusive.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, <samp>Device I/O error</samp> is raised for overrun error, framing error,
                and break interrupt. <samp>Device fault</samp> is raised if DSR is lost during I/O. A
                <samp>Parity error</samp> is raised if parity is enabled and incorrect parity is
                encountered. This is according to the manual; it is untested.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>bytes</var></code> is less than 1: <samp>Bad record number</samp>.
            </li>
            <li>
                <code><var>bytes</var></code> is less than <code>32768</code> and greater than the <code>COM</code> buffer length: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not specified: <samp>Missing operand</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                The serial input buffer is full, i.e. <code><a href="#LOF">LOF</a>(<var>com_file_number</var>) = 0</code> and
                <code><a href="#LOC">LOC</a>(<var>com_file_number</var>)=255</code>: <samp>Communication buffer overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="PUT-graphics"><code>PUT</code> statement (graphics)</h4>
        <code class="block">
            <b>PUT (</b><var>x0</var><b>,</b> <var>y0</var><b>),</b> <var>array_name</var> [<b>,</b> {<b>PSET</b>|<b>PRESET</b>|<b>AND</b>|<b>OR</b>|<b>XOR</b>}]
        </code>
        <p>
            Displays an array to a rectangular area of the graphics screen.
            Usually, <code>PUT</code> is used with arrays that have been stored using <code>GET</code>. See <code><a href="#GET-graphics">GET</a></code> for the
            format of the array.
        </p>
        <p>
            The keywords have the following effect:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>PSET</code></td>
                    <td>Overwrite the screen location with the new image</td>
                </tr>
                <tr>
                    <td><code>PRESET</code></td>
                    <td>Overwrite the screen location with the inverse image</td>
                </tr>
                <tr>
                    <td><code>AND</code></td>
                    <td>Combines the old and new attributes with bitwise AND</td>
                </tr>
                <tr>
                    <td><code>OR</code></td>
                    <td>Combines the old and new attributes with bitwise OR</td>
                </tr>
                <tr>
                    <td><code>XOR</code></td>
                    <td>Combines the old and new attributes with bitwise XOR</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>array_name</var></code> is a numeric array.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code> are numeric expressions.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The array does not exist: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>array_name</var></code> refers to a string array: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code> are string expressions: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code> is outside the current <code>VIEW</code> or <code>WINDOW</code>:
                <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="RANDOMIZE"><code>RANDOMIZE</code> statement</h4>
        <code class="block">
            <b>RANDOMIZE</b> [<var>expr</var>]
        </code>
        <p>
            Seeds the random number generator with <code><var>expr</var></code>.
            If no seed is specified, <code>RANDOMIZE</code> will prompt the user
            to enter a random seed. The user-provided value is rounded to an integer.
            The random seed is formed of the last two bytes of that integer or <code><var>expr</var></code>.
            If <code><var>expr</var></code> is a float (4 or 8 bytes), these are
            <code><a href="#boolean-operators">XOR</a></code>ed with the preceding 2. The
            first 4 bytes of a double are ignored.
            The same random seed will lead to the same sequence of pseudorandom numbers
            being generated by the <code><a href="#RND">RND</a></code> function.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>expr</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                For the same seed, PC-BASIC produces the same pseudorandom numbers as
                GW-BASIC 3.23.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>expr</var></code> has a string value: <samp>Illegal function call</samp>.
            </li>
            <li>
                The user provides a seed outside <code>[-32768&#8212;32767]</code> at the prompt: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="READ"><code>READ</code> statement</h4>
        <code class="block">
            <b>READ</b> <var>var_0</var> [<b>,</b> <var>var_1</var>] ...
        </code>
        <p>
            Assigns data from a <code><a href="#DATA">DATA</a></code> statement to variables. Reading starts at the current
            <code>DATA</code> position, which is the <code>DATA</code> entry immediately after the last one read by
            previous <code>READ</code> statements. The <code>DATA</code> position is reset
            to the start by the <code><a href="#RUN">RUN</a></code>
            and <code><a href="#RESTORE">RESTORE</a></code> statements.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>var_0</var></code>, <code><var>var_1</var></code> are variables or array elements.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Not enough data is present in <code>DATA</code> statements: <samp>Out of DATA</samp>.
            </li>
            <li>
                The type of the variable is not compatible with that of the data entry
                being read: a <samp>Syntax error</samp> occurs on the <code>DATA</code> line.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="REM"><code>REM</code> statement</h4>
        <code class="block">
            {<b>REM</b>|<b>'</b>} [<var>anything</var>]
        </code>
        <p>
            Ignores everything until the end of the line. The <code>REM</code> statement is intended for
            comments. Everything after <code>REM</code> will be stored in the program unaltered and
            uninterpreted. <code>'</code> (apostrophe) is an alias for <code>:REM'</code>; it can be placed at any
            point in the program line and will ensure that the rest of the line is ignored.
        </p>
    </section>
<hr>

    <section>
        <h4 id="RENUM"><code>RENUM</code> statement</h4>
        <code class="block">
            <b>RENUM</b> [<var>new</var>|<b>.</b>] [<b>,</b> [<var>old</var>|<b>.</b>] [<b>,</b> <var>increment</var>]]
        </code>
        <p>
            Replaces the line numbers in the program by a systematic enumeration starting
            from <code><var>new</var></code> and increasing by <code><var>increment</var></code>. If <code><var>old</var></code> is specified, line numbers
            less than 'old remain unchanged.
            <code><var>new</var></code>, <code><var>old</var></code> are line numbers; the dot . signifies the last line edited.
            <code><var>increment</var></code> is a line number but must not be a dot or zero.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                The following keywords can reference line numbers, which will be renumbered
                by <code>RENUM</code>: <code><a href="#AUTO">AUTO</a></code>, <code><a href="#EDIT">EDIT</a></code>,
                <code><a href="#ELSE">ELSE</a></code>, <code><a href="#ERL">ERL</a></code>,
                <code><a href="#DELETE">DELETE</a></code>, <code><a href="#GOSUB">GOSUB</a></code>,
                <code><a href="#GOTO">GOTO</a></code>, <code><a href="#LIST">LIST</a></code>,
                <code><a href="#LLIST">LLIST</a></code>, <code><a href="#RENUM">RENUM</a></code>,
                <code><a href="#RESTORE">RESTORE</a></code>, <code><a href="#RESUME">RESUME</a></code>,
                <code><a href="#RETURN">RETURN</a></code>, <code><a href="#RUN">RUN</a></code>,
                <code><a href="#THEN">THEN</a></code>.
            </li>
            <li>
                One keyword contains line numbers in a different program, which will not be
                renumbered: <code><a href="#CHAIN">CHAIN</a></code>. However, a line number
                in a <code>RUN</code> statement that
                opens a new file <em>will</em> be renumbered, and incorrectly so. Furthermore, any <code>RENUM</code>
                or <code>AUTO</code> statements in a program will have all their arguments 'renumbered',
                including any line number offsets or increments. However silly, this agrees with GW-BASIC's behaviour.
            </li>
            <li>
               If a referenced line number does not exist in the program, the statement prints a
                message (not an error) <code>Undefined line <var>ref</var> in <var>old_line</var></code> where <code><var>old_line</var></code>
                is the line number prior to renumbering. The referenced line number will be
                left unchanged, but the line's old line number will be renumbered.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters is not in <code>[0&#8212;65529]</code>: <samp>Syntax error</samp>.
            </li>
            <li>
                Any of the newly generated line numbers is greater than <code>65529</code>:
                <samp>Illegal function call</samp>. The line numbers up to the error have not been
                changed.
            </li>
            <li>
                <code><var>increment</var></code> is empty or zero: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>old</var></code> is specified and <code><var>new</var></code> is less than or equal to an existing line
                number less than old: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="RESET"><code>RESET</code> statement</h4>
        <code class="block">
            <b>RESET</b>
        </code>
        <p>
            Closes all open files.
        </p>
    </section>
<hr>

    <section>
        <h4 id="RESTORE"><code>RESTORE</code> statement</h4>
        <code class="block">
            <b>RESTORE</b> [<var>line</var>]
        </code>
        <p>
            Resets the <code><a href="#DATA">DATA</a></code> pointer.
            <code><var>line</var></code> is a line number. If <code><var>line</var></code>
            is not specified, the <code>DATA</code> pointer is reset to the first
            <code>DATA</code> entry in the program. If it is specified, the <code>DATA</code> pointer is
            reset to the first <code>DATA</code> entry in or after <code><var>line</var></code>.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line</var></code> is not an existing line number: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="RESUME"><code>RESUME</code> statement</h4>
        <code class="block">
            <b>RESUME</b> [<b>0</b>|<b>NEXT</b>|<var>line</var>]
        </code>
        <p>
            Continues normal execution after an error handling routine.
            If <code>0</code> or no option is specified, re-executes the statement that caused the
            error. If <code>NEXT</code> is specified, executes the statement following the one that
            caused the error. If <code><var>line</var></code> is specified, it must be a valid line number.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code>RESUME</code> is encountered outside of an error trapping routine:
                <samp>RESUME without error</samp>.
            </li>
            <li>
                The program ends inside an error trapping routine without a <code>RESUME</code>
                or <code>END</code> statement: <samp>No RESUME</samp>.
            </li>
            <li>
                <code><var>line</var></code> is not an existing line number: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="RETURN"><code>RETURN</code> statement</h4>
        <code class="block">
            <b>RETURN</b> [<var>line</var>]
        </code>
        <p>
            Returns from a <code><a href="#GOSUB">GOSUB</a></code> subroutine.
            If <code><var>line</var></code> is not specified, <code>RETURN</code> jumps back
            to the statement after the <code>GOSUB</code> that jumped into the subroutine.
            If <code><var>line</var></code> is specified, it must be a valid line number. <code>RETURN</code> jumps to that
            line (and pops the <code>GOSUB</code> stack).
            When returning from an error trapping routine, <code>RETURN</code> re-enables the event
            trapping which was stopped on entering the trap routine.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line</var></code> is not an existing line number: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="RIGHT$"><code>RIGHT$</code> function</h4>
        <code class="block">
            <var>child</var> <b>= RIGHT$(</b><var>parent</var><b>,</b> <var>num_chars</var><b>)</b>
        </code>
        <p>
            Returns the rightmost <code><var>num_chars</var></code> characters of <code><var>parent</var></code>.
            If <code><var>num_chars</var></code> is zero or <code><var>parent</var></code> is empty, <code>RIGHT$</code> returns
            an empty string. If <code><var>num_chars</var></code> is greater than the length of <code><var>parent</var></code>,
            returns <code><var>parent</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>parent</var></code> is a string expression.
            </li>
            <li>
                <code><var>num_chars</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num_chars</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="RMDIR"><code>RMDIR</code> statement</h4>
        <code class="block">
            <b>RMDIR</b> <var>path</var>
        </code>
        <p>
            Removes an empty directory on a disk device.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>path</var></code> is a string
                expression that specifies the path of the directory. The path
                may optionally be preceded by the device name. If the device name is
                omitted, a directory on the current disk is removed.
                Refer to the section on <a href="#eightpointthree">MS-DOS filenames</a>
                for information on how this statement matches filenames.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>path</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>path</var></code> is empty: <samp>Bad file name</samp> .
            </li>
            <li>
                No matching path is found: <samp>Path not found</samp> .
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="RND"><code>RND</code> function</h4>
        <code class="block">
            <var>random</var> <b>= RND</b>[<b>(</b><var>x</var><b>)</b>]
        </code>
        <p>
            Returns a pseudorandom number in the interval <code>[0&#8212;1)</code>.
            <code><var>x</var></code> is a numeric expression. If <code><var>x</var></code> is zero, <code>RND</code> repeats the last pseudo-
            random number. If <code><var>x</var></code> is greater than zero, a new pseudorandom number is
            returned. If <code><var>x</var></code> is negative, the value of <code><var>x</var></code> is used to generate a new
            random number seed; after that, a new pseudorandom number is returned.
            The seed is generated in a different way than by <code><a href="#RANDOMIZE">RANDOMIZE</a></code>.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="RSET"><code>RSET</code> statement</h4>
        <p>
            See <code><a href="#LSET">LSET</a></code>.
        </p>
    </section>
<hr>

    <section>
        <h4 id="RUN"><code>RUN</code> statement</h4>
        <code class="block">
            <b>RUN</b> [<var>line</var>|<var>filename</var>] [<b>,R</b>]
        </code>
        <p>
            Executes a program.
            Existing variables will be
            cleared and any program in memory will be erased. <code>RUN</code> implies a <code><a href="#CLEAR">CLEAR</a></code>
            If <code>,R</code> is specified, files are kept open; if not, all files are closed.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line</var></code> is a valid line number in the current program.
                If specified, execution starts from this line number.
            </li>
            <li>
                If <code><var>filename</var></code> is specified, the file with that name is loaded and executed.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line</var></code> does not exist: <samp>Undefined line number</samp>.
            </li>
            <li>
                <code><var>filename</var></code> cannot be found: <samp>File not found</samp>.
            </li>
            <li>
                <code><var>filename</var></code> is an empty string: <samp>Bad file number</samp>.
            </li>
            <li>
                A loaded ASCII file contains lines without line numbers:
                <samp>Direct statement in file</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SAVE"><code>SAVE</code> statement</h4>
        <code class="block">
            <b>SAVE</b> <var>file_spec</var> [<b>,</b> {<b>A</b>|<b>P</b>}]
        </code>
        <p>
            Stores the current program in a file.
        </p>
        <ul>
            <li>
                If <code><b>,A</b></code> is specified, the program will be saved in ASCII text format.
            </li>
            <li>
                If <code><b>,P</b></code> is specified, the program will be saved in protected format.
                When a protected program is loaded in GW-BASIC, it cannot be <code>LIST</code>ed or <code>SAVE</code>d in non-protected
                format.
            </li>
            <li>
                If neither is specified, the program will be saved in bytecode format.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is a string expression indicating the device and file to store to.
                See the <a href="#OPEN">OPEN</a> statement for valid file specifications.
                On disk devices, the file name will be converted to uppercase. If it
                is not an <a href="#eightpointthree">MS-DOS 8.3 filename</a>,
                additional characters will be clipped off and the name is converted to
                uppercase; if the filename contains no <code>.</code>, a default extension <code>.BAS</code> will
                be added. If the resulting file name already exists, it will be overwritten.
           </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> is an empty string: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                <code><a href="#--strict-protect">--strict-protect</a></code> is enabled, the current program is protected and <code>,P</code> is not specified:
                <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SCREEN-function"><code>SCREEN</code> function</h4>
        <code class="block">
            <var>value</var> <b>= SCREEN(</b><var>row</var><b>,</b> <var>column</var> [<b>,</b> <var>fn</var>]<b>)</b>
        </code>
        <p>
            Returns the ASCII code or colour attribute for the character at position
            <code><var>row</var></code>, <code><var>col</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>row</var></code> is a numeric expression in the range <code>[1&#8212;25]</code>.
            </li>
            <li>
                <code><var>col</var></code> is a numeric expression between 1 and the screen width (40 or 80).
            </li>
            <li>
                <code><var>fn</var></code> is a numeric expression in <code>[0&#8212;255]</code>. If it is zero or not specified,
                the ASCII code of the character is returned. If it is non-zero, in text mode the
                attribute is returned; in other screens, 0 is returned.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>row</var></code> is not inside the current <code>VIEW PRINT</code> area:
                <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><a href="#KEY-list">KEY ON</a></code> and <code><var>row</var>=25</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>col</var></code> is not in <code>[1, <var>width</var>]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SCREEN-statement"><code>SCREEN</code> statement</h4>
        <code class="block">
            <b>SCREEN</b> [<var>mode</var>] [<b>,</b> [<var>colorburst</var>] [<b>,</b> [<var>apage</var>] [<b>,</b> [<var>vpage</var>] [<b>,</b> <var>erase</var>]]]]
        </code>
        <p>
            Change the video mode, composite colorburst, active page and visible page. Video modes are described in the <a href="#videomodes">Video Modes</a> section.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mode</var></code> is a numeric expression that sets the screen mode.
            </li>
            <li>
                <code><var>colorburst</var></code> is a numeric expression. See notes below.
            </li>
            <li>
                <code><var>apage</var></code> is a numeric expression that sets the active page.
            </li>
            <li>
                <code><var>vpage</var></code> is a numeric expression that sets the visible page.
            </li>
            <li>
                <code><var>erase</var></code> is a numeric expression in the range <code>[0, 1, 2]</code>.
                It is only legal with <code><a href="#--syntax">--syntax</a>={pcjr, tandy}</code>. See notes below.
            </li>
        </ul>
        <h5>NTSC Composite Colorburst</h5>
        <p>
            On CGA, Tandy and PCjr, <code><var>colorburst</var></code> has the following effects, depending on the
            type of monitor - RGB (default) or composite:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>mode</var></code></th>
                    <th><code><var>colorburst</var></code></th>
                    <th>CGA mode</th>
                    <th>Effect (composite)</th>
                    <th>Effect (RGB)</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>0</td>
                    <td>0, 2</td>
                    <td>greyscale</td>
                    <td>default palette</td>
                </tr>
                <tr>
                    <td>0</td>
                    <td>1</td>
                    <td>1, 3</td>
                    <td>colour</td>
                    <td>default palette</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>0</td>
                    <td>4</td>
                    <td>colour</td>
                    <td>default palette</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>1</td>
                    <td>5</td>
                    <td>greyscale</td>
                    <td>alternate palette</td>
                </tr>
            </table>
        </div>
        <p>
            On <code>SCREEN 2</code>, <code><var>colorburst</var></code> has no effect; on a composite monitor, colour artifacts
            can be enabled on this screen through <code>OUT</code> (see there). On <code>SCREEN 3</code> and up, <code><var>colorburst</var></code> has no effect.
        </p>
        <h5>Erase</h5>
        <p>
            By default, if the <code><var>mode</var></code> changes or the <code><var>colorburst</var></code>
            changes between zero and non-zero, the old page and the new page of the screen
            are cleared. On <code><a href="#--syntax">--syntax</a>={pcjr, tandy}</code>,
            the <code><var>erase</var></code> parameter can be used to change this behaviour.
            Its values are as follows:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>erase</var></code></th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>0</code></td>
                    <td>Do not erase any screen page</td>
                </tr>
                <tr>
                    <td><code>1</code> (default)</td>
                    <td>If the <code><var>mode</var></code> changes or the <code><var>colorburst</var></code>
                    changes between zero and non-zero, the old page and the new page of the screen
                    are cleared.</td>
                </tr>
                <tr>
                    <td><code>2</code></td>
                    <td>If the <code><var>mode</var></code> changes or the <code><var>colorburst</var></code>
                    changes between zero and non-zero, all pages of the screen are cleared.</td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul><li>
            At least one parameter must be specified.
        </li><li>
            Composite colour artifacts are emulated only crudely in PC-BASIC, and not at
            all in <code>SCREEN 1</code>.
        </li></ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No parameters are specified: <samp>Missing operand</samp>.
            </li>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any parameter is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>mode</var></code> is not an available video mode number for your video card setting: <samp>Illegal function call</samp>.
            </li>
            <li>
            <code><var>vpage</var></code>, <code><var>apage</var></code> are not between 0 and the number of pages for the
                chosen video mode, less one:  <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>colorburst</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>erase</var></code> is not in <code>[0, 1, 2]</code>:
                <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SGN"><code>SGN</code> function</h4>
        <code class="block">
            <var>sign</var> <b>= SGN(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns the sign of <code><var>number</var></code>: <code>1</code> for positive, <code>0</code> for zero and <code>-1</code> for negative.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SHELL"><code>SHELL</code> statement</h4>
        <code class="block">
            <b>SHELL</b> [<var>command</var>]
        </code>
        <p>
            Starts a subshell on the console.
            The type of shell is determined by your OS. On Unix systems, an <code>sh</code> shell is
            started. On Windows systems, a <code>CMD.EXE</code> shell is started.
            If <code><var>command</var></code> is specified, the command is executed on the shell and execution
            returns to the program.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>command</var></code> is a string expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If the <code><a href="#--shell">--shell</a>=native</code> option is not specified, this statement does nothing.
            </li>
            <li>
            Be careful when enabling this command, as it allows the running BASIC program full access to your files and operating system.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>command</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
            <li>
                All output from the operating system subshell, including error messages, is displayed
                on the PC-BASIC screen.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SIN"><code>SIN</code> function</h4>
        <code class="block">
            <var>sine</var> <b>= SIN(</b><var>angle</var><b>)</b>
        </code>
        <p>
            Returns the sine of <code><var>angle</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
            <code><var>angle</var></code> is a numeric expression giving
            the angle in radians.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">--double</a></code>
                option, this function returns a single-precision value.
            </li>
            <li>
                The sine returned usually differs from the value returned by GW-BASIC in the least significant figure.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>angle</var></code> has a string value:
                <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SOUND"><code>SOUND</code> statement</h4>
        <code class="block">
            <b>SOUND</b> <var>frequency</var><b>,</b> <var>duration</var> [<b>,</b> <var>volume</var> [<b>,</b> <var>voice</var>]]
        </code>
        <p>
            Produces a sound at <code><var>frequency</var></code> Hz for <code><var>duration</var>/18.2</code> seconds.
            On PCjr and Tandy, the volume and voice channel can additionally be specified.
        </p>
        <p>
            If <code>PLAY "MB"</code> has been executed, <code>SOUND</code> plays in the background. If <code>PLAY "MF"</code>
            has been executed, sound plays in the foreground and the interpreter blocks
            until the sound is finished. Foreground mode is default. Unlike <code><a href="#PLAY">PLAY</a></code>, the
            sound played by the most recent <code>SOUND</code> statement always plays in the background,
            even if <code>PLAY "MF"</code> has been entered. In background mode, each <code>SOUND</code> statement
            counts as 1 toward the length of the queue reported by the <code><a href="#PLAY-function">PLAY</a></code> function.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>frequency</var></code> is a numeric expression in <code>[37&#8212;32767]</code> or <code>0</code> (for <code>--syntax={advanced | pcjr}</code>)
                or in <code>[-32768&#8212;32767]</code> (for <code>--syntax=tandy</code>).
            </li>
            <li>
                <code><var>duration</var></code> is a numeric expression in <code>[0&#8212;65535]</code>.
            </li>
            <li>
                <code><var>volume</var></code> is a numeric expression in [0, 15]. 0 is silent, 15 is full
                volume; every step less reduces the volume by 2 dB. (For <code>--syntax={pcjr | tandy}</code>)
            </li>
            <li>
                <code><var>voice</var></code> is a numeric expression in [0, 2], indicating which of the
                three tone voice channels is used for this sound. (For <code><a href="#--syntax">--syntax</a>={pcjr | tandy}</code>)
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                On PCjr and Tandy, Frequencies below 110 Hz are played as 110 Hz.
            </li>
            <li>
                If <code><var>duration</var></code> is zero, any active background sound is stopped and
                the sound queue is emptied.
            </li>
            <li>
                If <code><var>duration</var></code> is zero, <code><var>volume</var></code> and <code><var>voice</var></code> must not be specified.
            </li>
            <li>
                If <code><var>duration</var></code> is less than <code>.022</code> but nonzero, the sound will be played in
                background and continue indefinitely until another sound statement is
                executed. This is also the behaviour for negative <code><var>duration</var></code>.
            </li>
            <li>
                If <code><var>frequency</var></code> equals <code>32767</code> or <code>0</code>, a silence of length <code><var>duration</var></code> is queued.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any argument has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>frequency</var></code> is not in its allowed range, and <code><var>duration</var></code> is not zero:
                <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>duration</var></code> is zero and more than two arguments are specified:
                <samp>Syntax error</samp>.
            </li>
            <li>
                <code><a href="#--syntax">--syntax</a>={ pcjr | tandy }</code> is not set and more than two arguments are specified:
                <samp>Syntax error</samp>.
            </li>
            <li>
                <code><var>frequency</var></code> is not in <code>[-32768&#8212;32767]</code>:
                <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>duration</var></code> is not in <code>[-65535&#8212;65535]</code>:
                <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>volume</var></code> is not in <code>[0&#8212;15]</code>:
                <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>voice</var></code> is not in <code>[0&#8212;2]</code>:
                <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SOUND-switch"><code>SOUND</code> statement (switch)</h4>
        <code class="block">
            <b>SOUND</b> {<b>ON</b>|<b>OFF</b>}
        </code>
        <p>
            Toggles the availability of advanced sound capabilities on PCjr and Tandy. This includes 3-voice
            sound, noise generation and volume control.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Only available with <code>--syntax={pcjr | tandy}</code>.
            </li>
            <li>
               On PCjr and Tandy computers, <code>SOUND ON</code> would turn on the external speaker as
                well as make advanced sound capabilities available. On PC-BASIC, both the
                internal and the external speaker are emulated through the same sound
                system.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                This statement is used and <code><a href="#--syntax">--syntax</a>={ pcjr | tandy }</code> is not set:
                <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SPACE$"><code>SPACE$</code> function</h4>
        <code class="block">
            <var>spaces</var> <b>= SPACE$(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns a string of <code><var>number</var></code> spaces.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>number</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SQR"><code>SQR</code> function</h4>
        <code class="block">
            <var>root</var> <b>= SQR(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns the square root of <code><var>number</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">--double</a></code>
                option, this function returns a single-precision value.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> has a string value: <samp>Type mismatch</samp>
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="STICK"><code>STICK</code> function</h4>
        <code class="block">
            <var>pos</var> <b>= STICK(</b><var>axis</var><b>)</b>
        </code>
        <p>
            Returns a coordinate of a joystick axis. All coordinates returned are in the
            range <code>[1&#8212;254]</code> with <code>128</code> indicating the neutral position.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>axis</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>1st joystick x coordinate</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>1st joystick y coordinate</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>2nd joystick x coordinate</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>2nd joystick y coordinate</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>axis</var></code> is a numeric expression in <code>[0&#8212;3]</code> and indicates which axis to read.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>axis</var></code> has a string value: <samp>Type mismatch</samp>
            </li>
            <li>
                <code><var>axis</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>axis</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="STOP"><code>STOP</code> statement</h4>
        <code class="block">
            <b>STOP</b>
        </code>
        <p>
            Breaks program execution, prints a <samp>Break</samp>
            message on the console and returns control to the user. Files are not closed.
            It is possible to resume program execution at the next statement using
            <code><a href="#CONT">CONT</a></code>.
        </p>
    </section>
<hr>

    <section>
        <h4 id="STR$"><code>STR$</code> function</h4>
        <code class="block">
            <var>repr</var> <b>= STR$(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns the string representation of <code><var>number</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="STRIG-switch"><code>STRIG</code> statement</h4>
        <code class="block">
            <b>STRIG</b> {<b>ON</b>|<b>OFF</b>}
        </code>
        <p>
            Has no effect.
        </p>
    </section>
<hr>

    <section>
        <h4 id="STRIG-events"><code>STRIG</code> statement (events)</h4>
        <code class="block">
            <b>STRIG(</b><var>button</var><b>)</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <p>
            Switches event trapping of the joystick trigger <code><var>button</var></code>
            <code>ON</code> or <code>OFF</code>.
            <code>STRIG (<var>button</var>) STOP</code> suspends event trapping until
            <code>STRIG (<var>button</var>) ON</code> is executed. Up to one event can be triggered during
            suspension, provided that event handling was switched on prior to suspension.
            The event triggered during suspension is handled immediately after the next <code>STRIG (<var>button</var>) ON</code>
            statement.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>button</var></code></th>
                    <th>return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>1st joystick 1st trigger</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>2nd joystick 1st trigger</td>
                </tr>
                <tr>
                    <td>4</td>
                    <td>1st joystick 2nd trigger</td>
                </tr>
                <tr>
                    <td>6</td>
                    <td>2nd joystick 2nd trigger</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>button</var></code> is a numeric expression in <code>[0, 2, 4, 6]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>button</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>button</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>button</var></code> is not in <code>[0, 2, 4, 6]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
    <h4 id="STRIG-function"><code>STRIG</code> function</h4>
    <code class="block">
        <var>result</var> <b>= STRIG(</b><var>mode</var><b>)</b>
    </code>
    <p>
        Returns the status of the joystick trigger buttons.
        <code>STRIG</code> returns the following
        results, all Boolean values:
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th><code><var>mode</var></code></th>
                <th>Return value</th>
            </tr>
            <tr>
                <td>0</td>
                <td>1st joystick, 1st trigger has been pressed since last poll.</td>
            </tr>
            <tr>
                <td>1</td>
                <td>1st joystick, 1st trigger is currently pressed.</td>
            </tr>
            <tr>
                <td>2</td>
                <td>2nd joystick, 1st trigger has been pressed since last poll.</td>
            </tr>
            <tr>
                <td>3</td>
                <td>2nd joystick, 1st trigger is currently pressed.</td>
            </tr>
            <tr>
                <td>4</td>
                <td>1st joystick, 2nd trigger has been pressed since last poll.</td>
            </tr>
            <tr>
                <td>5</td>
                <td>1st joystick, 2nd trigger is currently pressed.</td>
            </tr>
            <tr>
                <td>6</td>
                <td>2nd joystick, 2nd trigger has been pressed since last poll.</td>
            </tr>
            <tr>
                <td>7</td>
                <td>2nd joystick, 2nd trigger is currently pressed.</td>
            </tr>
        </table>
    </div>
    <h5>Parameters</h5>
    <ul>
        <li>
            <code><var>mode</var></code> is a numeric expression in <code>[0&#8212;7]</code>.
        </li>
    </ul>
    <h5>Notes</h5>
    <ul>
        <li>
            The <code>STRIG</code> function returns correct results regardless of the
            <code><a href="#STRIG-switch">STRIG ON</a></code>
            status or whether <code><a href="#STRIG-function">STRIG(0)</a></code>
            has been called first.
        </li>
    </ul>
    <h5>Errors</h5>
    <ul>
        <li>
            <code><var>mode</var></code> has a string value: <samp>Type mismatch</samp>.
        </li>
        <li>
            <code><var>mode</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
        </li>
        <li>
            <code><var>mode</var></code> is not in <code>[0&#8212;7]</code>: <samp>Illegal function call</samp>.
        </li>
    </ul>
    </section>
<hr>

    <section>
        <h4 id="STRING$"><code>STRING$</code> function</h4>
        <code class="block">
            <var>string</var> <b>= STRING$(</b><var>length</var><b>,</b> <var>char</var><b>)</b>
        </code>
        <p>
            Returns a string of <code><var>length</var></code> times character <code><var>char</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                If <code><var>char</var></code> is a numeric expression, it must be in <code>[0&#8212;255]</code> and is
                interpreted as the ASCII value of the character.
            </li>
            <li>
                If <code><var>char</var></code> is a string expression, its first character is used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>length</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>char</var></code> is the empty string: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>char</var></code> or <code><var>length</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>char</var></code> or <code><var>length</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SWAP"><code>SWAP</code> statement</h4>
        <code class="block">
            <b>SWAP</b> <var>var_0</var><b>,</b> <var>var_1</var>
        </code>
        <p>
            Exchanges variables <code><var>var_0</var></code> and <code><var>var_1</var></code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                The variables are exchanged by reference. If, for example,
                <code><var>var_0</var></code> is a <code><a href="#FIELD">FIELD</a></code>
                variable and <code><var>var_1</var></code> is not, then
                <code>SWAP</code> will reverse those roles.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>var_0</var></code> and <code><var>var_1</var></code> are previously defined variables of
                the same type.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>var_0</var></code> or <code><var>var_1</var></code> is undefined: <samp>Illegal function call</samp>.
            </li>
            <li>
                The types of <code><var>var_0</var></code> and <code><var>var_1</var></code> are not the same: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="SYSTEM"><code>SYSTEM</code> statement</h4>
        <code class="block">
            <b>SYSTEM</b>
        </code>
        <p>
            Exits the interpreter.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>SYSTEM</code> quits the PC-BASIC interpreter immediately without further interaction.
                Any unsaved program or data will be lost.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="TAN"><code>TAN</code> function</h4>
        <code class="block">
            <var>tangent</var> <b>= TAN(</b><var>angle</var><b>)</b>
        </code>
        <p>
            Returns the tangent of <code><var>angle</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>angle</var></code> is a numeric expression giving
                the angle in radians.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">--double</a></code>
                option, this function returns a single-precision value.
            </li>
            <li>
                The tangent returned usually differs from the value returned by GW-BASIC in the least significant figure.
            </li>
            <li>
                For <code><var>angle</var></code> close to multiples of <code>&#960;/2</code>, the tangent is divergent or close
                to zero. The values returned will have very low precision in these cases.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>angle</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="TERM"><code>TERM</code> statement</h4>
        <code class="block">
            <b>TERM</b>
        </code>
        <p>
            Load and run the program defined by <code><a href="#--pcjr-term">--pcjr-term</a></code>.
            By default, as on the IBM PCjr, this is a
            built-in serial terminal emulator application.
            This statement is only available with
            <code><a href="#--syntax">--syntax</a>={pcjr|tandy}</code>.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                If <code><a href="#--pcjr-term">--pcjr-term</a></code> is not set,
                this statement raises <code>Internal error</code>.
            </li>
            <li>
                If <code><a href="#--syntax">--syntax</a></code> is not set to
                <code>pcjr</code> or <code>tandy</code>, this keyword is not present.
                Calling <code>TERM</code> will raise <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="TIME$-function"><code>TIME$</code> function</h4>
        <code class="block">
            <var>time</var> <b>= TIME$</b>
        </code>
        <p>
            Returns the current BASIC time in the form <code>"HH:mm:ss"</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This function has no brackets.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="TIME$-statement"><code>TIME$</code> statement</h4>
        <code class="block">
            <b>TIME$ = </b><var>time</var>
        </code>
        <p>
            Sets the current BASIC time to <code><var>time</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                Time is a string expression
                of the form <code>"HH:mm:ss"</code> where
                <code>00&lt;=HH&lt;24</code>, <code>00&lt;=mm&lt;60</code> and <code>00&lt;=ss&lt;60</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                PC-BASIC stores an offset to the system time and uses this for future
                calls to <code><a href="TIME%24-function">TIME$</a></code> and
                <code><a href="DATE%24-function">DATE$</a></code> functions in the same interpreter session.
                The system time is not changed, unlike GW-BASIC under MS-DOS.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>time</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>time</var></code> is not of the correct form: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="TIMER-event"><code>TIMER</code> statement</h4>
        <code class="block">
            <b>TIMER</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <ul>
            <li>
                <code>ON</code>: enables <code><a href="#ON-event">ON TIMER</a></code> event
                trapping of the timer clock.
            </li>
            <li>
                <code>OFF</code>: disables trapping.
            </li>
            <li>
                <code>STOP</code>: halts trapping until <code>TIMER ON</code> is used.
                Events that occur while trapping is halted will trigger immediately when
                trapping is re-enabled.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="TIMER"><code>TIMER</code> function</h4>
        <code class="block">
            <var>seconds</var> <b>= TIMER</b>
        </code>
        <p>
            Returns the number of seconds since midnight on the internal BASIC
            clock.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>TIMER</code> updates in ticks of 1/20 second.
            </li>
            <li>
                The least-significant two bytes of <code>TIMER</code> are often used as a seed for the
                pseudorandom number generator through <code><a href="#RANDOMIZE">RANDOMIZE</a> TIMER</code>. Since these bytes
                only take values from a limited set, that's not in fact a particularly good
                random seed. However, the pseudorandom number generator included with GW-BASIC and PC-BASIC
                is so weak that it should not be used for anything serious anyway.
            </li>
            <li>
            This function has no brackets.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="TRON"><code>TRON</code> and <code>TROFF</code> statements</h4>
        <code class="block">
            {<b>TRON</b>|<b>TROFF</b>}
        </code>
        <p>
            Turns line number tracing on or off. If line number tracing is on, BASIC prints
            a tag <samp>[100]</samp> to the console when program line <code>100</code> is executed, and so forth.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
               Tracing is turned off by the <code><a href="#NEW">NEW</a></code> and
               <code><a href="#LOAD">LOAD</a></code> statements.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="UNLOCK"><code>UNLOCK</code> statement</h4>
        <code class="block">
            <b>UNLOCK</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>record_0</var>]
        </code>
        <code class="block">
            <b>UNLOCK</b> [<b>#</b>] <var>file_number</var><b>,</b> [<var>record_0</var>] <b>TO</b> <var>record_1</var>
        </code>
        <p>
            Unlocks a file or part of it that has previously been locked with <code>LOCK</code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
            <li>
                <code><var>record_0</var></code> and <code><var>record_1</var></code> are numeric expressions in <code>[1&#8212;2^25-2]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                If <code><var>file_number</var></code> is open for <code>RANDOM</code>,
                <code><a href="#LOCK">LOCK</a></code> and <code><a href="#UNLOCK">UNLOCK</a></code>
                statements must match in terms of <code><var>record_0</var></code> and
                <code><var>record_1</var></code>. An non-matching <code>UNLOCK</code> will raise
                <samp>Permission denied</samp>.
            </li>
            <li>
                <code><var>record_0</var></code> or <code><var>record_1</var></code> is not in <code>[1&#8212;2^25-2]</code>: <samp>Bad record number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="USR"><code>USR</code> function</h4>
        <code class="block">
            <var>value</var> <b>= USR</b>[<var>n</var>]<b>(</b><var>expr</var><b>)</b>
        </code>
        <p>
            Returns zero.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>n</var></code> is a digit <code>[<b>0</b>&#8212;<b>9</b>]</code>.
            </li>
            <li>
                <code><var>expr</var></code> is an expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, calls a machine-code function and returns its return value.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> is not a digit <code>[<b>0</b>&#8212;<b>9</b>]</code>: <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="VAL"><code>VAL</code> function</h4>
        <code class="block">
            <var>value</var> <b>= VAL(</b><var>string</var><b>)</b>
        </code>
        <p>
            Returns the numeric value of the string expression <code><var>string</var></code>.
            Parsing stops as soon as the first character is encountered that cannot be
            part of a number. If no characters are parsed, <code>VAL</code> returns zero.
            See the section on <a href="#literals">numeric literals</a> for the
            recognised number formats.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Spaces before or even inside a number are ignored:
                <code>VAL(" 1 0")</code> returns <code>10</code>.
            </li>
            <li>
                If <code><var>string</var></code> contains one of the ASCII separator
                characters <code>CHR$(28)</code> (file separator),
                <code>CHR$(29)</code> (group separator) or
                <code>CHR$(31)</code> (unit separator),
                <code>VAL</code> returns zero.
                This is not the case with <code>CHR$(30)</code> (record separator).
                This behaviour conforms to GW-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="VARPTR"><code>VARPTR</code> function</h4>
        <code class="block">
            <var>pointer</var> <b>= VARPTR(</b>{<var>name</var>|<b>#</b><var>file_num</var>}<b>)</b>
        </code>
        <p>
            Returns the memory address of variable <code><var>name</var></code>
            or of the File Control Block of
            file number <code><var>file_num</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> is a
                previously defined variable or fully indexed array element.
            </li>
            <li>
                <code><var>file_num</var></code> is a legal file number.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>VARPTR</code> can be used with <code><a href="#PEEK">PEEK</a></code>
                to read a variable's internal representation.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>name</var></code> has not been previously defined: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[1, <var>max_files</var>]</code>,
                where <code><var>max_files</var></code> is the maximum number of files
                as set by the <code><a href="#--max-files">max-files</a></code> option:
                <samp>Bad file number</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="VARPTR$"><code>VARPTR$</code> function</h4>
        <code class="block">
            <var>pointer</var> <b>= VARPTR$(</b><var>name</var><b>)</b>
        </code>
        <p>
            Returns the memory address of variable <code><var>name</var></code> in the form of a 3-byte string.
            The first byte is the length of the record the pointer points to:
        </p>
        <dl class="compact">
            <dt>2</dt>
            <dd>for integers</dd>

            <dt>3</dt>
            <dd>for strings (length + pointer to string space)</dd>

            <dt>4</dt>
            <dd>for single-precision floats</dd>

            <dt>8</dt>
            <dd>for double-precision floats</dd>
        </dl>
        <p>
            The last two bytes are the pointer address (as returned by
            <code><a href="#VARPTR">VARPTR</a></code>) in little-endian order.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>name</var></code> has not been previously defined: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="VIEW"><code>VIEW</code> statement</h4>
        <code class="block">
            <b>VIEW</b> [[<b>SCREEN</b>] <b>(</b><var>x0</var><b>,</b> <var>y0</var><b>)-(</b><var>x1</var><b>,</b> <var>y1</var><b>)</b> [<b>,</b> [<var>fill</var>] [<b>,</b> <var>border</var>]]]
        </code>
        <p>
            Defines a graphics viewport. Graphics drawn outside the viewport will
            not be shown. <code>(<var>x0</var>, <var>y0</var>)</code>, <code>(<var>x1</var>, <var>y1</var>)</code> are absolute screen coordinates of two
            opposing corners of the area.
        </p>
        <p>
            Unless <code>SCREEN</code> is specified, after a <code>VIEW</code> statement the coordinate
            system is shifted such that <code>(0, 0)</code> becomes the top left coordinate of the viewport.
            If <code>VIEW</code> is called without arguments, the viewport is reset to the whole
            screen.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>fill</var></code> is an attribute. The viewport will be
                filled with this attribute.
            </li>
            <li>
                <code><var>border</var></code> is an attribute. A border will be drawn
                just outside the viewport with this attribute.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any of the coordinates is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                Any of the coordinate pairs is outside the physical screen: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="VIEW-PRINT"><code>VIEW PRINT</code> statement</h4>
        <code class="block">
            <b>VIEW PRINT</b> <var>top_row</var> <b>TO</b> <var>bottom_row</var>
        </code>
        <p>
            Defines the text scrolling area of the screen. <code><a href="#LOCATE">LOCATE</a></code> statements,
            cursor movement and scrolling will be limited to the scrolling area.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>top_row</var></code> and <code><var>bottom_row</var></code> are
                numeric expressions in  <code>[1&#8212;24]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><a href="#--syntax">--syntax</a>={pcjr | tandy}</code> and
                <code><a href="#KEY-list">KEY OFF</a></code> is set, <code><var>bottom_row</var></code> may be 25.
                Otherwise, screen row 25 cannot be part of the
                scrolling area.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>top_row</var></code> or <code><var>bottom_row</var></code> is not in <code>[1&#8212;24]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="WAIT"><code>WAIT</code> statement</h4>
        <code class="block">
            <b>WAIT</b> <var>port</var><b>,</b> <var>and_mask</var> [<b>,</b> <var>xor_mask</var>]
        </code>
        <p>
            Waits for the value of <code>(<a href="#INP">INP</a>(<var>port</var>)
            <a href="#boolean-operators">XOR</a> <var>xor_mask</var>) <a href="#boolean-operators">AND</a>
            <var>and_mask</var></code> to become nonzero.
            Event handling is suspended until <code>WAIT</code> returns.
            If <code><var>xor_mask</var></code> is not specified, it defaults to <code>0</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                A limited number of machine ports are emulated in PC-BASIC.
                See <code><a href="#INP">INP</a></code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>port</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>and_mask</var></code> or <code><var>xor_mask</var></code> are not in <code>[0&#8212;255]</code>: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="WEND"><code>WEND</code> statement</h4>
        <code class="block">
            <b>WEND</b>
        </code>
        <p>
            Iterates a <code>WHILE&#8212;WEND</code> loop: jumps to the matching
            <code><a href="#WHILE">WHILE</a></code> statement, where its
            condition can be checked.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
               <code>WHILE&#8212;WEND</code> loops can be nested. <code>WEND</code> jumps to the most recent <code>WHILE</code>
                statement that has not been closed by another <code>WEND</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                All previous <code>WHILE</code> statements have been closed by another
                <code>WEND</code> or no <code>WHILE</code> statement has been executed before:
                <samp>WEND without WHILE</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="WHILE"><code>WHILE</code> statement</h4>
        <code class="block">
            <b>WHILE</b> <var>expr</var>
        </code>
        <p>
            Initiates a <code>WHILE&#8212;WEND</code> loop.
            If <code><var>expr</var></code> evaluates to zero, <code>WHILE</code> jumps
            to the statement immediately after the matching
            <code><a href="#WEND">WEND</a></code>. If not, execution continues.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
            <code><var>expr</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No matching <code>WEND</code> is found: <samp>WHILE without WEND</samp>.
            </li>
            <li>
                <code><var>expr</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="WIDTH"><code>WIDTH</code> statement (console)</h4>
        <code class="block">
            <b>WIDTH</b> <var>num_columns</var> [<b>,</b> [<var>num_rows</var>] [<b>,</b>]]
        </code>
        <p>
            Sets the screen width to 20, 40 or 80 columns.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                When changing screen width in graphics mode, the video mode is changed.
                The following changes occur:<br>
                <code>SCREEN 1</code> (40)  &#8596;  <code>SCREEN 2</code> (80)<br>
                <code>SCREEN 7</code> (40)  &#8596;  <code>SCREEN 8</code> (80)<br>
                <code>SCREEN 7</code> (40)  &#8592;  <code>SCREEN 9</code> (80)<br>
            </li>
            <li>
                Screen width value 20 is only allowed on Tandy and PCjr. Changing to this width
                changes to <code>SCREEN 3</code>. Additionally, the following changes occur:<br>
                <code>SCREEN 3</code> (20)  &#8594;  <code>SCREEN 1</code> (40)<br>
                <code>SCREEN 3</code> (20)  &#8594;  <code>SCREEN 2</code> (80)<br>
                <code>SCREEN 4</code> (40)  &#8594;  <code>SCREEN 2</code> (80)<br>
                <code>SCREEN 5</code> (40)  &#8596;  <code>SCREEN 6</code> (80)<br>
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>num_columns</var></code> is either a literal <code>20</code>, <code>40</code> or <code>80</code> or a numeric expression in brackets.
                The trailing comma is optional and has no effect.
            </li>
            <li>
                <code><var>num_rows</var></code> is optional and must equal 25. If
                <code><a href="#--syntax">--syntax</a>={pcjr | tandy}</code> is set,
                <code><var>num_rows</var></code>
                may be in <code>[0&#8212;25]</code> but its value is ignored.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num_columns</var></code> is a string expression: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>num_columns</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num_columns</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>num_columns</var></code> is not a literal and not bracketed: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>num_rows</var></code> is not in its accepted range: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="WIDTH-files"><code>WIDTH</code> statement (devices and files)</h4>
        <code class="block">
            <b>WIDTH</b> {<b>#</b><var>file_num</var><b>,</b>|<var>device_name</var><b>,</b>|<b>LPRINT</b>} <var>num_columns</var>
        </code>
        <p>
            Sets the line width for a file or a device.
            When a write operation passes beyond the column width, a <code>CR LF</code> sequence is
            inserted.
        </p>
        <p>
            If a device is specified, it does not need to have a file open to it; the width setting will
            be the default width next time a file is opened to that device.
        </p>
        <p>
            If <code><var>device_name</var></code> is <code>"LPT1:"</code> or <code>LPRINT</code>
            is specified, the device width setting affects <code><a href="#LPRINT">LPRINT</a></code>
            and <code><a href="#LLIST">LLIST</a></code>.
        </p>
        <p>
            If <code><var>device_name</var></code> is <code>"SCRN:"</code>, <code>"KYBD:"</code>, or omitted, the screen width is changed.
            In this case, <code><var>num_columns</var></code> must be one of 20, 40 or 80.
            See the notes at <code><a href="#WIDTH">WIDTH</a></code> (console) for side effects.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> is a numeric expression which is the number of an open file.
            </li>
            <li>
                <code><var>device_name</var></code> is a string expression that is one of
                <code>"KYBD:"</code>, <code>"SCRN:"</code>, <code>"LPT1:"</code>, <code>"LPT2:"</code>,
                <code>"LPT3:"</code>, <code>"COM1:"</code>, <code>"COM2:"</code>, <code>"CAS1:"</code>
            </li>
            <li>
                <code><var>num_columns</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>device_name</var></code> is not one of the allowed devices: <samp>Bad file name</samp>.
            </li>
            <li>
                <code><var>device_name</var></code> is <code>"SCRN:"</code>, <code>"KYBD:"</code>
                and <code><var>num_columns</var></code> is not 20, 40 or
                80: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> or <code><var>num_columns</var></code> are strings: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> or <code><var>num_columns</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> or <code><var>num_columns</var></code> are not in <code>[0&#8212;255]</code>:    <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr>


    <section>
        <h4 id="WINDOW"><code>WINDOW</code> statement</h4>
        <code class="block">
            <b>WINDOW</b> [[<b>SCREEN</b>] <b>(</b><var>x0</var><b>,</b> <var>y0</var><b>)-(</b><var>x1</var><b>,</b> <var>y1</var><b>)</b>]
        </code>
        <p>
            Define logical coordinates for the viewport.
            If <code>SCREEN</code> is not specified,
            the bottom left of the screen is mapped to the lower coordinates;
            the top right of the screen is mapped to the higher coordinates.
            If <code>SCREEN</code> is specified,
            the top left of the screen is mapped to the lower coordinates;
            the bottom right of the screen is mapped to the higher coordinates.
        </p>
        <p>
            If <code>WINDOW</code> is called without arguments, the logical coordinates are
            reset to the viewport coordinates.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code>, <code><var>x1</var></code>, <code><var>y1</var></code> are numeric expressions.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the coordinates have a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x0</var> = <var>x1</var></code> or <code><var>y0</var> = <var>y1</var></code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr>

    <section>
        <h4 id="WRITE"><code>WRITE</code> statement</h4>
        <code class="block">
            <b>WRITE</b> [<b>#</b> <var>file_num</var><b>,</b>] <var>expr_0</var> [{<b>,</b>|<b>;</b>} <var>expr_1</var>] ...
        </code>
        <p>
            Writes values to a file or the screen in machine-readable form. Values are
            separated by commas and the line is ended with a <code>CR LF</code> sequence. Strings are
            delimited by double quotes <code>"</code>. No padding spaces are inserted.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>expr_0</var>, <var>expr_1</var>, ...</code> are expressions whose value is to be printed.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open for <code>INPUT</code>: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr>

</section>
<hr>

<section>
    <h3 id="error-trapping">Error trapping</h3>
    <p>
        Normally, any error will interrupt program execution and print a message on
        the console (exceptions are <samp>Overflow</samp> and
        <samp>Division by zero</samp>, which print a message but do not interrupt
        execution). It is possible to handle errors more graciously by
        setting an error-handling routine with the
        <code><a href="#ON-ERROR">ON ERROR</a> GOTO <var>line_number</var></code>
        statement. The error-handling routine starts at the given line number
        <code><var>line_number</var></code> and continues until a
        <code><a href="#RESUME">RESUME</a></code> statement is encountered.
        Error trapping is in effect both when a program is running and in interactive
        mode. Error trapping is switched off with the <code>ON ERROR GOTO 0</code>
        statement. If an error occurs, or error trapping is switched off, while the
        program is executing an error-trapping routine, the program terminates and
        an error message is shown.
    </p>
</section>
<hr>

<section>
    <h3 id="event-trapping">Event trapping</h3>
    <p>
        Event trapping allows to define subroutines which are executed outside of the normal course of operation. Events that can be trapped are:
    </p>
    <ul>
        <li>Time intervals (<code><a href="#ON-event">ON TIMER</a></code>)</li>
        <li>Keypresses (<code><a href="#ON-event">ON KEY</a></code>)</li>
        <li>Serial port input (<code><a href="#ON-event">ON COM</a></code>)</li>
        <li>Music queue exhaustion (<code><a href="#ON-event">ON PLAY</a></code>)</li>
        <li>Joystick triggers (<code><a href="#ON-event">ON STRIG</a></code>)</li>
        <li>Light pen activation (<code><a href="#ON-event">ON PEN</a></code>)</li>
    </ul>
    <p>
        Event trapping subroutines are defined as regular subroutines. At the
        <code><a href="#RETURN">RETURN</a></code> statement, the normal course of
        program execution is resumed. Event trapping can be switched on and off or
        paused temporarily with statements of the form
        <code><a href="#PEN-statement">PEN ON</a></code>, <code>PEN OFF</code>,
        <code>PEN STOP</code>.
        Event trapping only takes place during program execution and is paused while
        the program is in an error trap. If an event occurs while event-trapping is
        paused, then the event is triggered immediately when event trapping is resumed.
    </p>
</section>
<hr>

</article>
<!--
    PC-BASIC documentation
    Copyright (c) 2014-2015 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->

<article>
    <h2 id="technical">Technical reference</h2>

    <section>
        <h3 id="internal">Representation of variables</h3>
        <p>Internal representation:</p>
        <ul>
            <li>
               Line numbers are two-byte unsigned little-endian ints.
            </li>
            <li>
               Integers are two-byte signed little-endian two's complement ints.
            </li>
            <li>
               Floats are represented in the Microsoft Binary Format (MBF).
            </li>
        </ul>
        <p>
            GW-BASIC's floating point numbers are implemented in Microsoft Binary Format
            (MBF), which differs from the now ubiquitous IEEE 754 format. PC-BASIC follows
            GW-BASIC's implementation. Consequently, binary files generated by either BASIC are
            fully compatible with each other and with some applications contemporary to
            GW-BASIC, but not easily interchanged with other software. QBASIC, for example, uses IEEE 754
            floats.
        </p>
        <p>
            MBF differs from IEEE 754 in positioning the sign bit in a mantissa byte
            rather than the exponent, and in using only an 8-bit exponent even for double
            precision, making the range of allowable numbers in double precision smaller,
            but their precision higher, than for an IEEE double.
            Schematically, MBF floating point numbers are represented as follows.
        </p>
        <h5>Single precision</h5>
<pre>
    offset                             00   01   02   03
       use <var>                            m3   m2   m1   exp</var>
</pre>
        <h5>Double precision</h5>
<pre>
    offset         00   01   02   03   04   05   06   07
       use <var>        m7   m6   m5   m4   m3   m2   m1   exp</var>
</pre>
        <p>where:</p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code><var>exp</var></code></td>
                    <td>the exponent byte</td>
                </tr>
                <tr>
                    <td><code><var>m1</var></code></td>
                    <td>
                        most significant mantissa byte:
                        <code><var>m1</var> = <var>s f1 f2 f3 f4 f5 f6 f7</var></code>
                    </td>
                </tr>
                <tr>
                    <td><code><var>m2</var>&#8212;<var>m7</var></code></td>
                    <td>
                        bytes of decreasing significance:
                        <code><var>m2</var> = <var>f8 f9 fA fB fC fD fE fF</var></code>, etc.
                    </td>
                </tr>
                <tr>
                    <td><code><var>s</var></code></td>
                    <td>sign bit</td>
                </tr>
                <tr>
                    <td><code><var>f</var></code></td>
                    <td>fraction bit</td>
                </tr>
            </table>
        </div>
        <dl>
            <dt>sign</dt>
            <dd>If the sign bit is set, the number is negative.</dd>

            <dt>mantissa</dt>
            <dd>
                There is an assumed <code>1</code> bit after the radix point, so the mantissa binary
                fraction is <code>0 . 1 <var>f0 f1 f2</var> ...</code> where <code><var>f</var></code>s are the fraction bits.
            </dd>

            <dt>exponent</dt>
            <dd>
                The exponent is biased by 128: the mantissa fraction is multiplied by
                <code>2 ^ (<var>exp</var> - 128)</code>.
            </dd>

            <dt>zero</dt>
            <dd>
                Any float with the exponent byte set to <code>0</code> is interpreted as a zero.
            </dd>
        </dl>
        <p>
            A single-precision MBF float therefore has 23 bits of precision,
            while a double-precision MBF float has 55 bits of precision.
        </p>
    </section>
    <hr>

    <section>
        <h3 id="keywords">Keyword tokens</h3>
        <p>
            Not all keywords are statements or functions. Conversely, some parts of statement or
            function syntax are not keywords. Keywords are not legal variable names.
            Therefore, you cannot name a variable <code>TO!</code> but you can
            name it <code>AS!</code>: <code>TO</code> is a keyword but <code>AS</code> is not,
            even though both appear as part of BASIC statements.
        </p>
        <p>
            The keywords are listed below with the bytecode token used to
            represent them in a BASIC file.
        </p>
        <ul class="compact10">
            <li><code>81</code> <code>END</code></li>
            <li><code>82</code> <code>FOR</code></li>
            <li><code>83</code> <code>NEXT</code></li>
            <li><code>84</code> <code>DATA</code></li>
            <li><code>85</code> <code>INPUT</code></li>
            <li><code>86</code> <code>DIM</code></li>
            <li><code>87</code> <code>READ</code></li>
            <li><code>88</code> <code>LET</code></li>
            <li><code>89</code> <code>GOTO</code></li>
            <li><code>8A</code> <code>RUN</code></li>
            <li><code>8B</code> <code>IF</code></li>
            <li><code>8C</code> <code>RESTORE</code></li>
            <li><code>8D</code> <code>GOSUB</code></li>
            <li><code>8E</code> <code>RETURN</code></li>
            <li><code>8F</code> <code>REM</code></li>
            <li><code>90</code> <code>STOP</code></li>
            <li><code>91</code> <code>PRINT</code></li>
            <li><code>92</code> <code>CLEAR</code></li>
            <li><code>93</code> <code>LIST</code></li>
            <li><code>94</code> <code>NEW</code></li>
            <li><code>95</code> <code>ON</code></li>
            <li><code>96</code> <code>WAIT</code></li>
            <li><code>97</code> <code>DEF</code></li>
            <li><code>98</code> <code>POKE</code></li>
            <li><code>99</code> <code>CONT</code></li>
            <li><code>9C</code> <code>OUT</code></li>
            <li><code>9D</code> <code>LPRINT</code></li>
            <li><code>9E</code> <code>LLIST</code></li>
            <li><code>A0</code> <code>WIDTH</code></li>
            <li><code>A1</code> <code>ELSE</code></li>
            <li><code>A2</code> <code>TRON</code></li>
            <li><code>A3</code> <code>TROFF</code></li>
            <li><code>A4</code> <code>SWAP</code></li>
            <li><code>A5</code> <code>ERASE</code></li>
            <li><code>A6</code> <code>EDIT</code></li>
            <li><code>A7</code> <code>ERROR</code></li>
            <li><code>A8</code> <code>RESUME</code></li>
            <li><code>A9</code> <code>DELETE</code></li>
            <li><code>AA</code> <code>AUTO</code></li>
            <li><code>AB</code> <code>RENUM</code></li>
            <li><code>AC</code> <code>DEFSTR</code></li>
            <li><code>AD</code> <code>DEFINT</code></li>
            <li><code>AE</code> <code>DEFSNG</code></li>
            <li><code>AF</code> <code>DEFDBL</code></li>
            <li><code>B0</code> <code>LINE</code></li>
            <li><code>B1</code> <code>WHILE</code></li>
            <li><code>B2</code> <code>WEND</code></li>
            <li><code>B3</code> <code>CALL</code></li>
            <li><code>B7</code> <code>WRITE</code></li>
            <li><code>B8</code> <code>OPTION</code></li>
            <li><code>B9</code> <code>RANDOMIZE</code></li>
            <li><code>BA</code> <code>OPEN</code></li>
            <li><code>BB</code> <code>CLOSE</code></li>
            <li><code>BC</code> <code>LOAD</code></li>
            <li><code>BD</code> <code>MERGE</code></li>
            <li><code>BE</code> <code>SAVE</code></li>
            <li><code>BF</code> <code>COLOR</code></li>
            <li><code>C0</code> <code>CLS</code></li>
            <li><code>C1</code> <code>MOTOR</code></li>
            <li><code>C2</code> <code>BSAVE</code></li>
            <li><code>C3</code> <code>BLOAD</code></li>
            <li><code>C4</code> <code>SOUND</code></li>
            <li><code>C5</code> <code>BEEP</code></li>
            <li><code>C6</code> <code>PSET</code></li>
            <li><code>C7</code> <code>PRESET</code></li>
            <li><code>C8</code> <code>SCREEN</code></li>
            <li><code>C9</code> <code>KEY</code></li>
            <li><code>CA</code> <code>LOCATE</code></li>
            <li><code>CC</code> <code>TO</code></li>
            <li><code>CD</code> <code>THEN</code></li>
            <li><code>CE</code> <code>TAB(</code></li>
            <li><code>CF</code> <code>STEP</code></li>
            <li><code>D0</code> <code>USR</code></li>
            <li><code>D1</code> <code>FN</code></li>
            <li><code>D2</code> <code>SPC(</code></li>
            <li><code>D3</code> <code>NOT</code></li>
            <li><code>D4</code> <code>ERL</code></li>
            <li><code>D5</code> <code>ERR</code></li>
            <li><code>D6</code> <code>STRING$</code></li>
            <li><code>D7</code> <code>USING</code></li>
            <li><code>D8</code> <code>INSTR</code></li>
            <li><code>D9</code> <code>'</code></li>
            <li><code>DA</code> <code>VARPTR</code></li>
            <li><code>DB</code> <code>CSRLIN</code></li>
            <li><code>DC</code> <code>POINT</code></li>
            <li><code>DD</code> <code>OFF</code></li>
            <li><code>DE</code> <code>INKEY$</code></li>
            <li><code>E6</code> <code>&gt;</code></li>
            <li><code>E7</code> <code>=</code></li>
            <li><code>E8</code> <code>&lt;</code></li>
            <li><code>E9</code> <code>+</code></li>
            <li><code>EA</code> <code>-</code></li>
            <li><code>EB</code> <code>*</code></li>
            <li><code>EC</code> <code>/</code></li>
            <li><code>ED</code> <code>^</code></li>
            <li><code>EE</code> <code>AND</code></li>
            <li><code>EF</code> <code>OR</code></li>
            <li><code>F0</code> <code>XOR</code></li>
            <li><code>F1</code> <code>EQV</code></li>
            <li><code>F2</code> <code>IMP</code></li>
            <li><code>F3</code> <code>MOD</code></li>
            <li><code>F4</code> <code>\</code></li>
            <li><code>FD81</code> <code>CVI</code></li>
            <li><code>FD82</code> <code>CVS</code></li>
            <li><code>FD83</code> <code>CVD</code></li>
            <li><code>FD84</code> <code>MKI$</code></li>
            <li><code>FD85</code> <code>MKS$</code></li>
            <li><code>FD86</code> <code>MKD$</code></li>
            <li><code>FD8B</code> <code>EXTERR</code></li>
            <li><code>FE81</code> <code>FILES</code></li>
            <li><code>FE82</code> <code>FIELD</code></li>
            <li><code>FE83</code> <code>SYSTEM</code></li>
            <li><code>FE84</code> <code>NAME</code></li>
            <li><code>FE85</code> <code>LSET</code></li>
            <li><code>FE86</code> <code>RSET</code></li>
            <li><code>FE87</code> <code>KILL</code></li>
            <li><code>FE88</code> <code>PUT</code></li>
            <li><code>FE89</code> <code>GET</code></li>
            <li><code>FE8A</code> <code>RESET</code></li>
            <li><code>FE8B</code> <code>COMMON</code></li>
            <li><code>FE8C</code> <code>CHAIN</code></li>
            <li><code>FE8D</code> <code>DATE$</code></li>
            <li><code>FE8E</code> <code>TIME$</code></li>
            <li><code>FE8F</code> <code>PAINT</code></li>
            <li><code>FE90</code> <code>COM</code></li>
            <li><code>FE91</code> <code>CIRCLE</code></li>
            <li><code>FE92</code> <code>DRAW</code></li>
            <li><code>FE93</code> <code>PLAY</code></li>
            <li><code>FE94</code> <code>TIMER</code></li>
            <li><code>FE95</code> <code>ERDEV</code></li>
            <li><code>FE96</code> <code>IOCTL</code></li>
            <li><code>FE97</code> <code>CHDIR</code></li>
            <li><code>FE98</code> <code>MKDIR</code></li>
            <li><code>FE99</code> <code>RMDIR</code></li>
            <li><code>FE9A</code> <code>SHELL</code></li>
            <li><code>FE9B</code> <code>ENVIRON</code></li>
            <li><code>FE9C</code> <code>VIEW</code></li>
            <li><code>FE9D</code> <code>WINDOW</code></li>
            <li><code>FE9E</code> <code>PMAP</code></li>
            <li><code>FE9F</code> <code>PALETTE</code></li>
            <li><code>FEA0</code> <code>LCOPY</code></li>
            <li><code>FEA1</code> <code>CALLS</code></li>
            <li><code>FEA5</code> <code>PCOPY</code></li>
            <li><code>FEA7</code> <code>LOCK</code></li>
            <li><code>FEA8</code> <code>UNLOCK</code></li>
            <li><code>FF81</code> <code>LEFT$</code></li>
            <li><code>FF82</code> <code>RIGHT$</code></li>
            <li><code>FF83</code> <code>MID$</code></li>
            <li><code>FF84</code> <code>SGN</code></li>
            <li><code>FF85</code> <code>INT</code></li>
            <li><code>FF86</code> <code>ABS</code></li>
            <li><code>FF87</code> <code>SQR</code></li>
            <li><code>FF88</code> <code>RND</code></li>
            <li><code>FF89</code> <code>SIN</code></li>
            <li><code>FF8A</code> <code>LOG</code></li>
            <li><code>FF8B</code> <code>EXP</code></li>
            <li><code>FF8C</code> <code>COS</code></li>
            <li><code>FF8D</code> <code>TAN</code></li>
            <li><code>FF8E</code> <code>ATN</code></li>
            <li><code>FF8F</code> <code>FRE</code></li>
            <li><code>FF90</code> <code>INP</code></li>
            <li><code>FF91</code> <code>POS</code></li>
            <li><code>FF92</code> <code>LEN</code></li>
            <li><code>FF93</code> <code>STR$</code></li>
            <li><code>FF94</code> <code>VAL</code></li>
            <li><code>FF95</code> <code>ASC</code></li>
            <li><code>FF96</code> <code>CHR$</code></li>
            <li><code>FF97</code> <code>PEEK</code></li>
            <li><code>FF98</code> <code>SPACE$</code></li>
            <li><code>FF99</code> <code>OCT$</code></li>
            <li><code>FF9A</code> <code>HEX$</code></li>
            <li><code>FF9B</code> <code>LPOS</code></li>
            <li><code>FF9C</code> <code>CINT</code></li>
            <li><code>FF9D</code> <code>CSNG</code></li>
            <li><code>FF9E</code> <code>CDBL</code></li>
            <li><code>FF9F</code> <code>FIX</code></li>
            <li><code>FFA0</code> <code>PEN</code></li>
            <li><code>FFA1</code> <code>STICK</code></li>
            <li><code>FFA2</code> <code>STRIG</code></li>
            <li><code>FFA3</code> <code>EOF</code></li>
            <li><code>FFA4</code> <code>LOC</code></li>
            <li><code>FFA5</code> <code>LOF</code></li>
        </ul>
        <p>
            The following additional keywords are activated by
            <code><a href="#--syntax">--syntax</a>={pcjr|tandy}</code>.
        </p>
        <ul class="compact10">
            <li><code>FEA4</code> <code>NOISE</code></li>
            <li><code>FEA6</code> <code>TERM</code></li>
        </ul>
        <p>
            The following additional keyword is activated by <code><a href="#--debug">--debug</a></code>.
            It is specific to PC-BASIC and not present in GW-BASIC.
        </p>
        <ul class="compact10">
            <li><code>FFFF</code> <code>DEBUG</code></li>
        </ul>
    </section>
    <hr>

    <section>
        <h3 id="errors">Error codes</h3>
        <div class="scrollable">
            <table>
                <tr><td><code>1</code></td><td><samp>NEXT without FOR</samp></td></tr>
                <tr><td><code>2</code></td><td><samp>Syntax error</samp></td></tr>
                <tr><td><code>3</code></td><td><samp>RETURN without GOSUB</samp></td></tr>
                <tr><td><code>4</code></td><td><samp>Out of DATA</samp></td></tr>
                <tr><td><code>5</code></td><td><samp>Illegal function call</samp></td></tr>
                <tr><td><code>6</code></td><td><samp>Overflow</samp></td></tr>
                <tr><td><code>7</code></td><td><samp>Out of memory</samp></td></tr>
                <tr><td><code>8</code></td><td><samp>Undefined line number</samp></td></tr>
                <tr><td><code>9</code></td><td><samp>Subscript out of range</samp></td></tr>
                <tr><td><code>10</code></td><td><samp>Duplicate Definition</samp></td></tr>
                <tr><td><code>11</code></td><td><samp>Division by zero</samp></td></tr>
                <tr><td><code>12</code></td><td><samp>Illegal direct</samp></td></tr>
                <tr><td><code>13</code></td><td><samp>Type mismatch</samp></td></tr>
                <tr><td><code>14</code></td><td><samp>Out of string space</samp></td></tr>
                <tr><td><code>15</code></td><td><samp>String too long</samp></td></tr>
                <tr><td><code>16</code></td><td><samp>String formula too complex</samp></td></tr>
                <tr><td><code>17</code></td><td><samp>Can't continue</samp></td></tr>
                <tr><td><code>18</code></td><td><samp>Undefined user function</samp></td></tr>
                <tr><td><code>19</code></td><td><samp>No RESUME</samp></td></tr>
                <tr><td><code>20</code></td><td><samp>RESUME without error</samp></td></tr>
                <tr><td><code>21</code></td><td><i>unused</i></td></tr>
                <tr><td><code>22</code></td><td><samp>Missing operand</samp></td></tr>
                <tr><td><code>23</code></td><td><samp>Line buffer overflow</samp></td></tr>
                <tr><td><code>24</code></td><td><samp>Device Timeout</samp></td></tr>
                <tr><td><code>25</code></td><td><samp>Device Fault</samp></td></tr>
                <tr><td><code>26</code></td><td><samp>FOR without NEXT</samp></td></tr>
                <tr><td><code>27</code></td><td><samp>Out of paper</samp></td></tr>
                <tr><td><code>28</code></td><td><i>unused</i></td></tr>
                <tr><td><code>29</code></td><td><samp>WHILE without WEND</samp></td></tr>
                <tr><td><code>30</code></td><td><samp>WEND without WHILE</samp></td></tr>
                <tr><td><code>31&#8212;49</code></td><td><i>unused</i></td></tr>
                <tr><td><code>50</code></td><td><samp>FIELD overflow</samp></td></tr>
                <tr><td><code>51</code></td><td><samp>Internal error</samp></td></tr>
                <tr><td><code>52</code></td><td><samp>Bad file number</samp></td></tr>
                <tr><td><code>53</code></td><td><samp>File not found</samp></td></tr>
                <tr><td><code>54</code></td><td><samp>Bad file mode</samp></td></tr>
                <tr><td><code>55</code></td><td><samp>File already open</samp></td></tr>
                <tr><td><code>56</code></td><td><i>unused</i></td></tr>
                <tr><td><code>57</code></td><td><samp>Device I/O error</samp></td></tr>
                <tr><td><code>58</code></td><td><samp>File already exists</samp></td></tr>
                <tr><td><code>59&#8212;60</code></td><td><i>unused</i></td></tr>
                <tr><td><code>61</code></td><td><samp>Disk full</samp></td></tr>
                <tr><td><code>62</code></td><td><samp>Input past end</samp></td></tr>
                <tr><td><code>63</code></td><td><samp>Bad record number</samp></td></tr>
                <tr><td><code>64</code></td><td><samp>Bad file name</samp></td></tr>
                <tr><td><code>65</code></td><td><i>unused</i></td></tr>
                <tr><td><code>66</code></td><td><samp>Direct statement in file</samp></td></tr>
                <tr><td><code>67</code></td><td><samp>Too many files</samp></td></tr>
                <tr><td><code>68</code></td><td><samp>Device Unavailable</samp></td></tr>
                <tr><td><code>69</code></td><td><samp>Communication buffer overflow</samp></td></tr>
                <tr><td><code>70</code></td><td><samp>Permission Denied</samp></td></tr>
                <tr><td><code>71</code></td><td><samp>Disk not Ready</samp></td></tr>
                <tr><td><code>72</code></td><td><samp>Disk media error</samp></td></tr>
                <tr><td><code>73</code></td><td><samp>Advanced Feature</samp></td></tr>
                <tr><td><code>74</code></td><td><samp>Rename across disks</samp></td></tr>
                <tr><td><code>75</code></td><td><samp>Path/File access error</samp></td></tr>
                <tr><td><code>76</code></td><td><samp>Path not found</samp></td></tr>
                <tr><td><code>77</code></td><td><samp>Deadlock</samp></td></tr>
            </table>
        </div>
        <p>
            Any error code that does not have a message associated to it will generate
            the message <samp>Unprintable error</samp>.
        </p>
    </section>
    <hr>

    <section>
        <h3 id="videomodes">Video modes</h3>
        <p>The video modes are as follows:</p>
        <dl>
            <dt><code>SCREEN 0</code> Text mode</dt>
            <dd>
                80x25 or 40x25 characters of 8x16 pixels<br>
                16 attributes picked from 64 colours<br>
                Attributes 16-31 are blinking versions of 0-15<br>
                4 pages <code>ega</code>
            </dd>
            <dt><code>SCREEN 1</code> CGA colour</dt>
            <dd>
                320x200 pixels<br>
                40x25 characters of 8x8 pixels<br>
                4 attributes picked from 16 colours; 2 bits per pixel<br>
                1 page <code>ega</code> 2 pages <code>pcjr</code> <code>tandy</code><br>
            </dd>
            <dt><code>SCREEN 2</code> CGA monochrome</dt>
            <dd>
                640x200 pixels<br>
                80x25 characters of 8x8 pixels<br>
                2 attributes picked from 16 colours; 1 bit per pixel<br>
                1 page <code>ega</code> 2 pages <code>pcjr</code> <code>tandy</code><br>
            </dd>
            <dt><code>SCREEN 3</code> Low-res 16-colour <code>pcjr</code> <code>tandy</code></dt>
            <dd>
                160x200 pixels<br>
                20x25 characters of 8x8 pixels<br>
                16 attributes picked from 16 colours; 4 bits per pixel<br>
                2 pages<br>
            </dd><dt><code>SCREEN 3</code> Hercules monochrome <code>hercules</code><br></dt>
            <dd>
                720x348 pixels<br>
                80x25 characters of 9x14 pixels (with bottom line truncated by 2 px)<br>
                2 attributes; 1 bit per pixel<br>
                2 pages<br>
            </dd>
            <dt><code>SCREEN 3&#8212;255</code> Altissima risoluzione <code>olivetti</code><br></dt>
            <dd>
                640x400 pixels<br>
                80x25 characters of 8x16 pixels<br>
                2 attributes of which one picked from 16 colours; 2 bits per pixel<br>
                1 page<br>
            </dd>
            <dt><code>SCREEN 4</code> Med-res 4-colour <code>pcjr</code> <code>tandy</code><br></dt>
            <dd>
                320x200 pixels<br>
                40x25 characters of 8x8 pixels<br>
                4 attributes picked from 16 colours; 2 bits per pixel<br>
                2 pages<br>
            </dd>
            <dt><code>SCREEN 5</code> Med-res 16-colour <code>pcjr</code> <code>tandy</code><br></dt>
            <dd>
                320x200 pixels<br>
                40x25 characters of 8x8 pixels<br>
                16 attributes picked from 16 colours; 4 bits per pixel<br>
                1 page<br>
                <p><em>Note: a minimum of 32768 bytes of video memory must be
                reserved to use this video mode.</em> Use the statement
                <code><a href="#CLEAR">CLEAR</a> ,,,32768!</code>
                or the option
                <code><a href="#--video-memory">video-memory</a>=32768</code>.</p>
            </dd>
            <dt><code>SCREEN 6</code> High-res 4-colour <code>pcjr</code> <code>tandy</code><br></dt>
            <dd>
                640x200 pixels<br>
                80x25 characters of 8x8 pixels<br>
                4 attributes picked from 16 colours; 2 bits per pixel<br>
                1 page<br>
                <p><em>Note: a minimum of 32768 bytes of video memory must be
                reserved to use this video mode.</em> Use the statement
                <code><a href="#CLEAR">CLEAR</a> ,,,32768!</code>
                or the option
                <code><a href="#--video-memory">video-memory</a>=32768</code>.</p>
            </dd>
            <dt><code>SCREEN 7</code> EGA colour <code>ega</code></dt>
            <dd>
                320x200 pixels<br>
                40x25 characters of 8x8 pixels<br>
                16 attributes picked from 16 colours; 4 bits per pixel<br>
                8 pages<br>
            </dd>
            <dt><code>SCREEN 8</code> EGA colour <code>ega</code></dt>
            <dd>
                640x200 pixels<br>
                80x25 characters of 8x8 pixels<br>
                16 attributes picked from 16 colours; 4 bits per pixel<br>
                4 pages<br>
            </dd>
            <dt><code>SCREEN 9</code> EGA colour <code>ega</code></dt>
            <dd>
                640x350 pixels<br>
                80x25 characters of 8x14 pixels<br>
                16 attributes picked from 64 colours; 4 bits per pixel<br>
                2 pages<br>
            </dd>
            <dt><code>SCREEN 10</code> EGA monochrome <code>ega</code> <code>monitor=mono</code></dt>
            <dd>
                640x350 pixels<br>
                80x25 characters of 8x14 pixels<br>
                4 attributes picked from 9 pseudocolours; 2 bits per pixel<br>
                2 pages<br>
            </dd>
        </dl>
    </section>
    <hr>


    <section>
        <h3 id="ascii">ASCII</h3>
        <p>
            This is a list of the Americal Standard Code for Information Interchange (ASCII).
            ASCII only covers 128 characters and defines the code point ranges
            <code>&amp;H00</code>&#160;<code>&amp;H1F</code> and <code>&amp;7F</code>
            as <i>control characters</i> which do not have a printable glyph assigned
            to them. This includes such values as the <i>Carriage Return</i> (<code><i>CR</i></code>)
            character that ends a program line.
        </p>
        <p>
            Depending on context, PC-BASIC will treat a code point in
            the control characters range as a control character or as a
            glyph defined by the active <a href="#codepages">codepage</a> which by
            default is <a href="#cp437">codepage 437</a>. Code points of
            <code>&amp;H80</code> or higher are always interpreted as a
            codepage glyph.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td>&#160;</td>
                    <th><code>_0</code></th>
                    <th><code>_1</code></th>
                    <th><code>_2</code></th>
                    <th><code>_3</code></th>
                    <th><code>_4</code></th>
                    <th><code>_5</code></th>
                    <th><code>_6</code></th>
                    <th><code>_7</code></th>
                    <th><code>_8</code></th>
                    <th><code>_9</code></th>
                    <th><code>_A</code></th>
                    <th><code>_B</code></th>
                    <th><code>_C</code></th>
                    <th><code>_D</code></th>
                    <th><code>_E</code></th>
                    <th><code>_F</code></th>
                </tr>
                <tr>
                    <th><code>0_</code></th>
                    <td><code><i>NUL</i></code></td>
                    <td><code><i>SOH</i></code></td>
                    <td><code><i>STX</i></code></td>
                    <td><code><i>ETX</i></code></td>
                    <td><code><i>EOT</i></code></td>
                    <td><code><i>ENQ</i></code></td>
                    <td><code><i>ACK</i></code></td>
                    <td><code><i>BEL</i></code></td>
                    <td><code><i>BS&#160;</i></code></td>
                    <td><code><i>HT&#160;</i></code></td>
                    <td><code><i>LF&#160;</i></code></td>
                    <td><code><i>VT&#160;</i></code></td>
                    <td><code><i>FF&#160;</i></code></td>
                    <td><code><i>CR&#160;</i></code></td>
                    <td><code><i>SO&#160;</i></code></td>
                    <td><code><i>SI&#160;</i></code></td>
                </tr>
                <tr>
                    <th><code>1_</code></th>
                    <td><code><i>DLE</i></code></td>
                    <td><code><i>DC1</i></code></td>
                    <td><code><i>DC2</i></code></td>
                    <td><code><i>DC3</i></code></td>
                    <td><code><i>DC4</i></code></td>
                    <td><code><i>NAK</i></code></td>
                    <td><code><i>SYN</i></code></td>
                    <td><code><i>ETB</i></code></td>
                    <td><code><i>CAN</i></code></td>
                    <td><code><i>EM&#160;</i></code></td>
                    <td><code><i>SUB</i></code></td>
                    <td><code><i>ESC</i></code></td>
                    <td><code><i>FS&#160;</i></code></td>
                    <td><code><i>GS&#160;</i></code></td>
                    <td><code><i>RS&#160;</i></code></td>
                    <td><code><i>US&#160;</i></code></td>
                </tr>
                <tr>
                    <th><code>2_</code></th>
                    <td><code> </code></td>
                    <td><code>!</code></td>
                    <td><code>"</code></td>
                    <td><code>#</code></td>
                    <td><code>$</code></td>
                    <td><code>%</code></td>
                    <td><code>&amp;</code></td>
                    <td><code>'</code></td>
                    <td><code>(</code></td>
                    <td><code>)</code></td>
                    <td><code>*</code></td>
                    <td><code>+</code></td>
                    <td><code>,</code></td>
                    <td><code>-</code></td>
                    <td><code>.</code></td>
                    <td><code>/</code></td>
                </tr>
                <tr>
                    <th><code>3_</code></th>
                    <td><code>0</code></td>
                    <td><code>1</code></td>
                    <td><code>2</code></td>
                    <td><code>3</code></td>
                    <td><code>4</code></td>
                    <td><code>5</code></td>
                    <td><code>6</code></td>
                    <td><code>7</code></td>
                    <td><code>8</code></td>
                    <td><code>9</code></td>
                    <td><code>:</code></td>
                    <td><code>;</code></td>
                    <td><code>&lt;</code></td>
                    <td><code>=</code></td>
                    <td><code>&gt;</code></td>
                    <td><code>?</code></td>
                </tr>
                <tr>
                    <th><code>4_</code></th>
                    <td><code>@</code></td>
                    <td><code>A</code></td>
                    <td><code>B</code></td>
                    <td><code>C</code></td>
                    <td><code>D</code></td>
                    <td><code>E</code></td>
                    <td><code>F</code></td>
                    <td><code>G</code></td>
                    <td><code>H</code></td>
                    <td><code>I</code></td>
                    <td><code>J</code></td>
                    <td><code>K</code></td>
                    <td><code>L</code></td>
                    <td><code>M</code></td>
                    <td><code>N</code></td>
                    <td><code>O</code></td>
                </tr>
                <tr>
                    <th><code>5_</code></th>
                    <td><code>P</code></td>
                    <td><code>Q</code></td>
                    <td><code>R</code></td>
                    <td><code>S</code></td>
                    <td><code>T</code></td>
                    <td><code>U</code></td>
                    <td><code>V</code></td>
                    <td><code>W</code></td>
                    <td><code>X</code></td>
                    <td><code>Y</code></td>
                    <td><code>Z</code></td>
                    <td><code>[</code></td>
                    <td><code>\</code></td>
                    <td><code>]</code></td>
                    <td><code>^</code></td>
                    <td><code>_</code></td>
                </tr>
                <tr>
                    <th><code>6_</code></th>
                    <td><code>`</code></td>
                    <td><code>a</code></td>
                    <td><code>b</code></td>
                    <td><code>c</code></td>
                    <td><code>d</code></td>
                    <td><code>e</code></td>
                    <td><code>f</code></td>
                    <td><code>g</code></td>
                    <td><code>h</code></td>
                    <td><code>i</code></td>
                    <td><code>j</code></td>
                    <td><code>k</code></td>
                    <td><code>l</code></td>
                    <td><code>m</code></td>
                    <td><code>n</code></td>
                    <td><code>o</code></td>
                </tr>
                <tr>
                    <th><code>7_</code></th>
                    <td><code>p</code></td>
                    <td><code>q</code></td>
                    <td><code>r</code></td>
                    <td><code>s</code></td>
                    <td><code>t</code></td>
                    <td><code>u</code></td>
                    <td><code>v</code></td>
                    <td><code>w</code></td>
                    <td><code>x</code></td>
                    <td><code>y</code></td>
                    <td><code>z</code></td>
                    <td><code>{</code></td>
                    <td><code>|</code></td>
                    <td><code>}</code></td>
                    <td><code>~</code></td>
                    <td><code><i>DEL</i></code></td>
                </tr>
            </table>
        </div>
    </section>
    <hr>

    <section>
        <h3 id="cp437">Codepage 437</h3>
        <p>
            This table shows the characters that
            are produced by the 256 single-byte code points when
            the DOS Latin USA codepage 437 is loaded, which is the default.
            Other codepages can be loaded to assign other characters to these
            code points.
        </p>
        <ul>
            <li>
                Code point <code>&amp;H00</code> cannot be redefined.
            </li>
            <li>
                Redefining characters
                in the printable ASCII code point range <code>&amp;H20</code>&#8211;<code>&amp;H7E</code>
                will result in a different glyph being shown on the screen, but the
                character will continue to be treated as the corresponding ASCII character.
                It will retain its ASCII value when transcoded into UTF-8. This happens,
                for example, with the Yen sign (<code>&#165;</code>) which is
                assigned to ASCII code point <code>&amp;H5C</code> in code page 932:
                in that codepage it is treated as if it were a backslash (<code>\</code>).
            </li>
            <li>
                All other characters can be redefined by loading another codepage,
                which will affect both their visual glyph and Unicode
                character value.
            </li>
        </ul>
        <div class="scrollable">
            <table>
                <tr>
                    <td>&#160;</td>
                    <th><code>_0</code></th>
                    <th><code>_1</code></th>
                    <th><code>_2</code></th>
                    <th><code>_3</code></th>
                    <th><code>_4</code></th>
                    <th><code>_5</code></th>
                    <th><code>_6</code></th>
                    <th><code>_7</code></th>
                    <th><code>_8</code></th>
                    <th><code>_9</code></th>
                    <th><code>_A</code></th>
                    <th><code>_B</code></th>
                    <th><code>_C</code></th>
                    <th><code>_D</code></th>
                    <th><code>_E</code></th>
                    <th><code>_F</code></th>
                </tr>
                <tr>
                    <th><code>0_</code></th>
                    <td><code></code></td>
                    <td><code>&#9786;</code></td>
                    <td><code>&#9787;</code></td>
                    <td><code>&#9829;</code></td>
                    <td><code>&#9830;</code></td>
                    <td><code>&#9827;</code></td>
                    <td><code>&#9824;</code></td>
                    <td><code>&#8226;</code></td>
                    <td><code>&#9688;</code></td>
                    <td><code>&#9675;</code></td>
                    <td><code>&#9689;</code></td>
                    <td><code>&#9794;</code></td>
                    <td><code>&#9792;</code></td>
                    <td><code>&#9834;</code></td>
                    <td><code>&#9835;</code></td>
                    <td><code>&#9788;</code></td>
                </tr>
                <tr>
                    <th><code>1_</code></th>
                    <td><code>&#9658;</code></td>
                    <td><code>&#9668;</code></td>
                    <td><code>&#8597;</code></td>
                    <td><code>&#8252;</code></td>
                    <td><code>&#182;</code></td>
                    <td><code>&#167;</code></td>
                    <td><code>&#9644;</code></td>
                    <td><code>&#8616;</code></td>
                    <td><code>&#8593;</code></td>
                    <td><code>&#8595;</code></td>
                    <td><code>&#8594;</code></td>
                    <td><code>&#8592;</code></td>
                    <td><code>&#8735;</code></td>
                    <td><code>&#8596;</code></td>
                    <td><code>&#9650;</code></td>
                    <td><code>&#9660;</code></td>
                </tr>
                <tr>
                    <th><code>2_</code></th>
                    <td><code> </code></td>
                    <td><code>!</code></td>
                    <td><code>"</code></td>
                    <td><code>#</code></td>
                    <td><code>$</code></td>
                    <td><code>%</code></td>
                    <td><code>&amp;</code></td>
                    <td><code>'</code></td>
                    <td><code>(</code></td>
                    <td><code>)</code></td>
                    <td><code>*</code></td>
                    <td><code>+</code></td>
                    <td><code>,</code></td>
                    <td><code>-</code></td>
                    <td><code>.</code></td>
                    <td><code>/</code></td>
                </tr>
                <tr>
                    <th><code>3_</code></th>
                    <td><code>0</code></td>
                    <td><code>1</code></td>
                    <td><code>2</code></td>
                    <td><code>3</code></td>
                    <td><code>4</code></td>
                    <td><code>5</code></td>
                    <td><code>6</code></td>
                    <td><code>7</code></td>
                    <td><code>8</code></td>
                    <td><code>9</code></td>
                    <td><code>:</code></td>
                    <td><code>;</code></td>
                    <td><code>&lt;</code></td>
                    <td><code>=</code></td>
                    <td><code>&gt;</code></td>
                    <td><code>?</code></td>
                </tr>
                <tr>
                    <th><code>4_</code></th>
                    <td><code>@</code></td>
                    <td><code>A</code></td>
                    <td><code>B</code></td>
                    <td><code>C</code></td>
                    <td><code>D</code></td>
                    <td><code>E</code></td>
                    <td><code>F</code></td>
                    <td><code>G</code></td>
                    <td><code>H</code></td>
                    <td><code>I</code></td>
                    <td><code>J</code></td>
                    <td><code>K</code></td>
                    <td><code>L</code></td>
                    <td><code>M</code></td>
                    <td><code>N</code></td>
                    <td><code>O</code></td>
                </tr>
                <tr>
                    <th><code>5_</code></th>
                    <td><code>P</code></td>
                    <td><code>Q</code></td>
                    <td><code>R</code></td>
                    <td><code>S</code></td>
                    <td><code>T</code></td>
                    <td><code>U</code></td>
                    <td><code>V</code></td>
                    <td><code>W</code></td>
                    <td><code>X</code></td>
                    <td><code>Y</code></td>
                    <td><code>Z</code></td>
                    <td><code>[</code></td>
                    <td><code>\</code></td>
                    <td><code>]</code></td>
                    <td><code>^</code></td>
                    <td><code>_</code></td>
                </tr>
                <tr>
                    <th><code>6_</code></th>
                    <td><code>`</code></td>
                    <td><code>a</code></td>
                    <td><code>b</code></td>
                    <td><code>c</code></td>
                    <td><code>d</code></td>
                    <td><code>e</code></td>
                    <td><code>f</code></td>
                    <td><code>g</code></td>
                    <td><code>h</code></td>
                    <td><code>i</code></td>
                    <td><code>j</code></td>
                    <td><code>k</code></td>
                    <td><code>l</code></td>
                    <td><code>m</code></td>
                    <td><code>n</code></td>
                    <td><code>o</code></td>
                </tr>
                <tr>
                    <th><code>7_</code></th>
                    <td><code>p</code></td>
                    <td><code>q</code></td>
                    <td><code>r</code></td>
                    <td><code>s</code></td>
                    <td><code>t</code></td>
                    <td><code>u</code></td>
                    <td><code>v</code></td>
                    <td><code>w</code></td>
                    <td><code>x</code></td>
                    <td><code>y</code></td>
                    <td><code>z</code></td>
                    <td><code>{</code></td>
                    <td><code>|</code></td>
                    <td><code>}</code></td>
                    <td><code>~</code></td>
                    <td><code>&#8962;</code></td>
                </tr>
                <tr>
                    <th><code>8_</code></th>
                    <td><code>&#199;</code></td>
                    <td><code>&#252;</code></td>
                    <td><code>&#233;</code></td>
                    <td><code>&#226;</code></td>
                    <td><code>&#228;</code></td>
                    <td><code>&#224;</code></td>
                    <td><code>&#229;</code></td>
                    <td><code>&#231;</code></td>
                    <td><code>&#234;</code></td>
                    <td><code>&#235;</code></td>
                    <td><code>&#232;</code></td>
                    <td><code>&#239;</code></td>
                    <td><code>&#238;</code></td>
                    <td><code>&#236;</code></td>
                    <td><code>&#196;</code></td>
                    <td><code>&#197;</code></td>
                </tr>
                <tr>
                    <th><code>9_</code></th>
                    <td><code>&#201;</code></td>
                    <td><code>&#230;</code></td>
                    <td><code>&#198;</code></td>
                    <td><code>&#244;</code></td>
                    <td><code>&#246;</code></td>
                    <td><code>&#242;</code></td>
                    <td><code>&#251;</code></td>
                    <td><code>&#249;</code></td>
                    <td><code>&#255;</code></td>
                    <td><code>&#214;</code></td>
                    <td><code>&#220;</code></td>
                    <td><code>&#162;</code></td>
                    <td><code>&#163;</code></td>
                    <td><code>&#165;</code></td>
                    <td><code>&#8359;</code></td>
                    <td><code>&#402;</code></td>
                </tr>
                <tr>
                    <th><code>A_</code></th>
                    <td><code>&#225;</code></td>
                    <td><code>&#237;</code></td>
                    <td><code>&#243;</code></td>
                    <td><code>&#250;</code></td>
                    <td><code>&#241;</code></td>
                    <td><code>&#209;</code></td>
                    <td><code>&#170;</code></td>
                    <td><code>&#186;</code></td>
                    <td><code>&#191;</code></td>
                    <td><code>&#8976;</code></td>
                    <td><code>&#172;</code></td>
                    <td><code>&#189;</code></td>
                    <td><code>&#188;</code></td>
                    <td><code>&#161;</code></td>
                    <td><code>&#171;</code></td>
                    <td><code>&#187;</code></td>
                </tr>
                <tr>
                    <th><code>B_</code></th>
                    <td><code>&#9617;</code></td>
                    <td><code>&#9618;</code></td>
                    <td><code>&#9619;</code></td>
                    <td><code>&#9474;</code></td>
                    <td><code>&#9508;</code></td>
                    <td><code>&#9569;</code></td>
                    <td><code>&#9570;</code></td>
                    <td><code>&#9558;</code></td>
                    <td><code>&#9557;</code></td>
                    <td><code>&#9571;</code></td>
                    <td><code>&#9553;</code></td>
                    <td><code>&#9559;</code></td>
                    <td><code>&#9565;</code></td>
                    <td><code>&#9564;</code></td>
                    <td><code>&#9563;</code></td>
                    <td><code>&#9488;</code></td>
                </tr>
                <tr>
                    <th><code>C_</code></th>
                    <td><code>&#9492;</code></td>
                    <td><code>&#9524;</code></td>
                    <td><code>&#9516;</code></td>
                    <td><code>&#9500;</code></td>
                    <td><code>&#9472;</code></td>
                    <td><code>&#9532;</code></td>
                    <td><code>&#9566;</code></td>
                    <td><code>&#9567;</code></td>
                    <td><code>&#9562;</code></td>
                    <td><code>&#9556;</code></td>
                    <td><code>&#9577;</code></td>
                    <td><code>&#9574;</code></td>
                    <td><code>&#9568;</code></td>
                    <td><code>&#9552;</code></td>
                    <td><code>&#9580;</code></td>
                    <td><code>&#9575;</code></td>
                </tr>
                <tr>
                    <th><code>D_</code></th>
                    <td><code>&#9576;</code></td>
                    <td><code>&#9572;</code></td>
                    <td><code>&#9573;</code></td>
                    <td><code>&#9561;</code></td>
                    <td><code>&#9560;</code></td>
                    <td><code>&#9554;</code></td>
                    <td><code>&#9555;</code></td>
                    <td><code>&#9579;</code></td>
                    <td><code>&#9578;</code></td>
                    <td><code>&#9496;</code></td>
                    <td><code>&#9484;</code></td>
                    <td><code>&#9608;</code></td>
                    <td><code>&#9604;</code></td>
                    <td><code>&#9612;</code></td>
                    <td><code>&#9616;</code></td>
                    <td><code>&#9600;</code></td>
                </tr>
                <tr>
                    <th><code>E_</code></th>
                    <td><code>&#945;</code></td>
                    <td><code>&#223;</code></td>
                    <td><code>&#915;</code></td>
                    <td><code>&#960;</code></td>
                    <td><code>&#931;</code></td>
                    <td><code>&#963;</code></td>
                    <td><code>&#181;</code></td>
                    <td><code>&#964;</code></td>
                    <td><code>&#934;</code></td>
                    <td><code>&#920;</code></td>
                    <td><code>&#937;</code></td>
                    <td><code>&#948;</code></td>
                    <td><code>&#8734;</code></td>
                    <td><code>&#966;</code></td>
                    <td><code>&#949;</code></td>
                    <td><code>&#8745;</code></td>
                </tr>
                <tr>
                    <th><code>F_</code></th>
                    <td><code>&#8801;</code></td>
                    <td><code>&#177;</code></td>
                    <td><code>&#8805;</code></td>
                    <td><code>&#8804;</code></td>
                    <td><code>&#8992;</code></td>
                    <td><code>&#8993;</code></td>
                    <td><code>&#247;</code></td>
                    <td><code>&#8776;</code></td>
                    <td><code>&#176;</code></td>
                    <td><code>&#8729;</code></td>
                    <td><code>&#183;</code></td>
                    <td><code>&#8730;</code></td>
                    <td><code>&#8319;</code></td>
                    <td><code>&#178;</code></td>
                    <td><code>&#9632;</code></td>
                    <td><code>&#160;</code></td>
                </tr>
            </table>
        </div>
    </section>
    <hr>

    <section>
        <h3 id="scancodes">Keyboard scancodes</h3>
        <p>
            PC-BASIC uses PC/XT scancodes, which originated on the 83-key IBM Model F keyboard
            supplied with the IBM PC 5150. The layout of this keyboard was quite distinct
            from modern standard keyboards with 101 or more keys, but keys on a modern keyboard produce
            the same scancode as the key with the same function on the Model F. For example,
            the key that (on a US keyboard) produces the <kbd>\</kbd> was located next to
            the left <kbd>Shift</kbd> key on the Model F keyboard and has scancode
            <code>&amp;h2B</code>. The (US) backslash key still has this scancode, even
            though it is now usually found above the <kbd>Enter</kbd> key.
        </p>
        <p>
            To further complicate matters, keyboards for different locales have their layout remapped in software
            rather than in hardware, which means that they produce the same scancode as
            the key that on a US keyboard is in the same location, regardless of which character they actually produce.
        </p>
        <p>
            Therefore, the <kbd>A</kbd> on
            a French keyboard will produce the same scancode as the <kbd>Q</kbd> on a UK or US keyboard.
            The aforementioned US <kbd>\</kbd> key is identified with the key that is generally found
            to the bottom left of <kbd>Enter</kbd> on non-US keyboards. For example, on my UK keyboard
            this is the <kbd>#</kbd> key. Non-US keyboards have an additional key next
            to the left <kbd>Shift</kbd> which on the UK keyboard is the <kbd>\</kbd>. Therefore,
            while this key is in the same location and has the same function as the Model F <kbd>\</kbd>,
            it has a different scancode.
        </p>
        <p>
            In the table below, the keys are marked by their function on a US keyboard,
            but it should be kept in mind that the scancode is linked to the position,
            not the function, of the key.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Key</th>
                    <th>Scancode</th>
                </tr>
                <tr>
                    <td><kbd>Esc</kbd></td>
                    <td>01</td>
                </tr>
                <tr>
                    <td><kbd>1 !</kbd></td>
                    <td>02</td>
                </tr>
                <tr>
                    <td><kbd>2 @</kbd></td>
                    <td>03</td>
                </tr>
                <tr>
                    <td><kbd>3 #</kbd></td>
                    <td>04</td>
                </tr>
                <tr>
                    <td><kbd>4 $</kbd></td>
                    <td>05</td>
                </tr>
                <tr>
                    <td><kbd>5 %</kbd></td>
                    <td>06</td>
                </tr>
                <tr>
                    <td><kbd>6 ^</kbd></td>
                    <td>07</td>
                </tr>
                <tr>
                    <td><kbd>7 &amp;</kbd></td>
                    <td>08</td>
                </tr>
                <tr>
                    <td><kbd>8 *</kbd></td>
                    <td>09</td>
                </tr>
                <tr>
                    <td><kbd>9 (</kbd></td>
                    <td>0A</td>
                </tr>
                <tr>
                    <td><kbd>0 )</kbd></td>
                    <td>0B</td>
                </tr>
                <tr>
                    <td><kbd>- _</kbd></td>
                    <td>0C</td>
                </tr>
                <tr>
                    <td><kbd>= +</kbd></td>
                    <td>0D</td>
                </tr>
                <tr>
                    <td><kbd>Backspace</kbd></td>
                    <td>0E</td>
                </tr>
                <tr>
                    <td><kbd>Tab</kbd></td>
                    <td>0F</td>
                </tr>
                <tr>
                    <td><kbd>q Q</kbd></td>
                    <td>10</td>
                </tr>
                <tr>
                    <td><kbd>w W</kbd></td>
                    <td>11</td>
                </tr>
                <tr>
                    <td><kbd>e E</kbd></td>
                    <td>12</td>
                </tr>
                <tr>
                    <td><kbd>r R</kbd></td>
                    <td>13</td>
                </tr>
                <tr>
                    <td><kbd>t T</kbd></td>
                    <td>14</td>
                </tr>
                <tr>
                    <td><kbd>y Y</kbd></td>
                    <td>15</td>
                </tr>
                <tr>
                    <td><kbd>u U</kbd></td>
                    <td>16</td>
                </tr>
                <tr>
                    <td><kbd>i I</kbd></td>
                    <td>17</td>
                </tr>
                <tr>
                    <td><kbd>o O</kbd></td>
                    <td>18</td>
                </tr>
                <tr>
                    <td><kbd>p P</kbd></td>
                    <td>19</td>
                </tr>
                <tr>
                    <td><kbd>[ {</kbd></td>
                    <td>1A</td>
                </tr>
                <tr>
                    <td><kbd>] }</kbd></td>
                    <td>1B</td>
                </tr>
                <tr>
                    <td><kbd>Enter</kbd></td>
                    <td>1C</td>
                </tr>
                <tr>
                    <td><kbd>Ctrl</kbd></td>
                    <td>1D</td>
                </tr>
                <tr>
                    <td><kbd>a A</kbd></td>
                    <td>1E</td>
                </tr>
                <tr>
                    <td><kbd>s S</kbd></td>
                    <td>1F</td>
                </tr>
                <tr>
                    <td><kbd>d D</kbd></td>
                    <td>20</td>
                </tr>
                <tr>
                    <td><kbd>f F</kbd></td>
                    <td>21</td>
                </tr>
                <tr>
                    <td><kbd>g G</kbd></td>
                    <td>22</td>
                </tr>
                <tr>
                    <td><kbd>h H</kbd></td>
                    <td>23</td>
                </tr>
                <tr>
                    <td><kbd>j J</kbd></td>
                    <td>24</td>
                </tr>
                <tr>
                    <td><kbd>k K</kbd></td>
                    <td>25</td>
                </tr>
                <tr>
                    <td><kbd>l L</kbd></td>
                    <td>26</td>
                </tr>
                <tr>
                    <td><kbd>; :</kbd></td>
                    <td>27</td>
                </tr>
                <tr>
                    <td><kbd>' "</kbd></td>
                    <td>28</td>
                </tr>
                <tr>
                    <td><kbd>` ~</kbd></td>
                    <td>29</td>
                </tr>
                <tr>
                    <td><kbd>Left Shift</kbd></td>
                    <td>2A</td>
                </tr>
                <tr>
                    <td><kbd>\ |</kbd></td>
                    <td>2B</td>
                </tr>
                <tr>
                    <td><kbd>z Z</kbd></td>
                    <td>2C</td>
                </tr>
                <tr>
                    <td><kbd>x X</kbd></td>
                    <td>2D</td>
                </tr>
                <tr>
                    <td><kbd>c C</kbd></td>
                    <td>2E</td>
                </tr>
                <tr>
                    <td><kbd>v V</kbd></td>
                    <td>2F</td>
                </tr>
                <tr>
                    <td><kbd>b B</kbd></td>
                    <td>  30</td>
                </tr>
                <tr>
                    <td><kbd>n N</kbd></td>
                    <td>31</td>
                </tr>
                <tr>
                    <td><kbd>m M</kbd></td>
                    <td>32</td>
                </tr>
                <tr>
                    <td><kbd>, &lt;</kbd></td>
                    <td>33</td>
                </tr>
                <tr>
                    <td><kbd>. &gt;</kbd></td>
                    <td>34</td>
                </tr>
                <tr>
                    <td><kbd>/ ?</kbd></td>
                    <td>35</td>
                </tr>
                <tr>
                    <td><kbd>Right Shift</kbd></td>
                    <td>36</td>
                </tr>
                <tr>
                    <td><kbd>keypad *</kbd> <kbd>PrtSc</kbd></td>
                    <td>37</td>
                </tr>
                <tr>
                    <td><kbd>Alt</kbd></td>
                    <td>38</td>
                </tr>
                <tr>
                    <td><kbd>Space</kbd></td>
                    <td>39</td>
                </tr>
                <tr>
                    <td><kbd>Caps Lock</kbd></td>
                    <td>3A</td>
                </tr>
                <tr>
                    <td><kbd>F1</kbd></td>
                    <td>3B</td>
                </tr>
                <tr>
                    <td><kbd>F2</kbd></td>
                    <td>3C</td>
                </tr>
                <tr>
                    <td><kbd>F3</kbd></td>
                    <td>3D</td>
                </tr>
                <tr>
                    <td><kbd>F4</kbd></td>
                    <td>3E</td>
                </tr>
                <tr>
                    <td><kbd>F5</kbd></td>
                    <td>3F</td>
                </tr>
                <tr>
                    <td><kbd>F6</kbd></td>
                    <td>40</td>
                </tr>
                <tr>
                    <td><kbd>F7</kbd></td>
                    <td>41</td>
                </tr>
                <tr>
                    <td><kbd>F8</kbd></td>
                    <td>42</td>
                </tr>
                <tr>
                    <td><kbd>F9</kbd></td>
                    <td>43</td>
                </tr>
                <tr>
                    <td><kbd>F10</kbd></td>
                    <td>44</td>
                </tr>
                <tr>
                    <td><kbd>Num Lock</kbd></td>
                    <td>45</td>
                </tr>
                <tr>
                    <td><kbd>Scroll Lock</kbd> <kbd>Pause</kbd></td>
                    <td>46</td>
                </tr>
                <tr>
                    <td><kbd>keypad 7</kbd> <kbd>Home</kbd></td>
                    <td>47</td>
                </tr>
                <tr>
                    <td><kbd>keypad 8</kbd> <kbd>&#8593;<!--up--></kbd></td>
                    <td>48</td>
                </tr>
                <tr>
                    <td><kbd>keypad 9</kbd> <kbd>Pg Up</kbd></td>
                    <td>49</td>
                </tr>
                <tr>
                    <td><kbd>keypad -</kbd></td>
                    <td>4A</td>
                </tr>
                <tr>
                    <td><kbd>keypad 4</kbd> <kbd>&#8592;<!--left--></kbd></td>
                    <td>4B</td>
                </tr>
                <tr>
                    <td><kbd>keypad 5</kbd></td>
                    <td>4C</td>
                </tr>
                <tr>
                    <td><kbd>keypad 6</kbd> <kbd>&#8594;<!--right--></kbd></td>
                    <td>4D</td>
                </tr>
                <tr>
                    <td><kbd>keypad +</kbd></td>
                    <td>4E</td>
                </tr>
                <tr>
                    <td><kbd>keypad 1</kbd> <kbd>End</kbd></td>
                    <td>4F</td>
                </tr>
                <tr>
                    <td><kbd>keypad 2</kbd> <kbd>&#8595;<!--down--></kbd></td>
                    <td>50</td>
                </tr>
                <tr>
                    <td><kbd>keypad 3</kbd> <kbd>Pg Dn</kbd></td>
                    <td>51</td>
                </tr>
                <tr>
                    <td><kbd>keypad 0</kbd> <kbd>Ins</kbd></td>
                    <td>52</td>
                </tr>
                <tr>
                    <td><kbd>keypad .</kbd> <kbd>Del</kbd></td>
                    <td>53</td>
                </tr>
                <tr>
                    <td><kbd>SysReq</kbd></td>
                    <td>54</td>
                </tr>
                <tr>
                    <td><kbd>\ |</kbd> (Non-US 102-key) </td>
                    <td>56</td>
                </tr>
                <tr>
                    <td><kbd>F11</kbd></td>
                    <td>57</td>
                </tr>
                <tr>
                    <td><kbd>F12</kbd></td>
                    <td>58</td>
                </tr>
                <tr>
                    <td><kbd>Left Logo</kbd> (Windows 104-key)</td>
                    <td>5B</td>
                </tr>
                <tr>
                    <td><kbd>Right Logo</kbd> (Windows 104-key)</td>
                    <td>5C</td>
                </tr>
                <tr>
                    <td><kbd>Menu</kbd> (Windows 104-key)</td>
                    <td>5D</td>
                </tr>
                <tr>
                    <td><kbd>&#12402;&#12425;&#12364;&#12394;/&#12459;&#12479;&#12459;&#12490; Hiragana/Katakana</kbd> (Japanese 106-key)</td>
                    <td>70</td>
                </tr>
                <tr>
                    <td><kbd>\ _</kbd>  (Japanese 106-key)</td>
                    <td>73</td>
                </tr>
                <tr>
                    <td><kbd>&#22793;&#25563; Henkan</kbd>  (Japanese 106-key)</td>
                    <td>79</td>
                </tr>
                <tr>
                    <td><kbd>&#28961;&#22793;&#25563; Muhenkan</kbd>  (Japanese 106-key)</td>
                    <td>7B</td>
                </tr>
                <tr>
                    <td><kbd>&#21322;&#35282;/&#20840;&#35282; Hankaku/Zenkaku</kbd>  (Japanese 106-key)</td>
                    <td>29</td>
                </tr>
                <tr>
                    <td><kbd>&#165; |</kbd>  (Japanese 106-key)</td>
                    <td>7D</td>
                </tr>
                <tr>
                    <td><kbd>&#54620;&#51088; Hanja</kbd>  (Korean 103-key)</td>
                    <td>F1</td>
                </tr>
                <tr>
                    <td><kbd>&#54620;/&#50689; Han/Yeong</kbd>  (Korean 103-key)</td>
                    <td>F2</td>
                </tr>
                <tr>
                    <td><kbd>\ ? &#176;</kbd>  (Brazilian ABNT2)</td>
                    <td>73</td>
                </tr>
                <tr>
                    <td><kbd>keypad .</kbd>  (Brazilian ABNT2)</td>
                    <td>7E</td>
                </tr>
            </table>
        </div>
    </section>
    <hr>

    <section>
        <h3 id="eascii">Extended ASCII codes</h3>
        <p>
            In addition to <a href="#scancodes">scancodes</a>, most keys also carry
            a character value given as 'extended ASCII'. e-ASCII codes are one or
            two bytes long; single-byte codes are simply ASCII codes whereas
            double-byte codes consist of a <code>CHR$(0)</code> character plus
            a code indicating the key pressed. Some, but certainly not all,
            of these codes agree with the keys' scancodes.
        </p>
        <p>
            Unlike scancodes, e-ASCII codes of unmodified keys and those
            of keys modified by <kbd>Shift</kbd>, <kbd>Ctrl</kbd> or <kbd>Alt</kbd>
            are all different.
        </p>
        <p>
            Unmodified, <kbd>Shift</kbd>ed and <kbd>Ctrl</kbd>ed e-ASCII codes are
            connected to a key's meaning, not its location. For example, the e-ASCII
            for <kbd>Ctrl</kbd>+<kbd>a</kbd> are the same on a
            French and a US keyboard.
            By contrast, the <kbd>Alt</kbd>ed codes are connected
            to the key's location, like scancodes.
            The US keyboard layout is used in the table below.
        </p>
        <p>
            The values returned by the
            <a href="#INKEY%24"><code>INKEY$</code></a> function are e-ASCII values.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Key</th>
                    <th>e-ASCII</th>
                    <th>e-ASCII <kbd>Shift</kbd></th>
                    <th>e-ASCII <kbd>Ctrl</kbd></th>
                    <th>e-ASCII <kbd>Alt</kbd></th>
                </tr>
                <tr>
                    <td><kbd>Esc</kbd></td>
                    <td><code>1B</code></td>
                    <td><code>1B</code></td>
                    <td><code>1B</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>1 !</kbd></td>
                    <td><code>31</code></td>
                    <td><code>21</code></td>
                    <td></td>
                    <td><code>00 78</code></td>
                </tr>
                <tr>
                    <td><kbd>2 @</kbd></td>
                    <td><code>32</code></td>
                    <td><code>40</code></td>
                    <td><code>00 03</code></td>
                    <td><code>00 79</code></td>
                </tr>
                <tr>
                    <td><kbd>3 #</kbd></td>
                    <td><code>33</code></td>
                    <td><code>23</code></td>
                    <td></td>
                    <td><code>00 7A</code></td>
                </tr>
                <tr>
                    <td><kbd>4 $</kbd></td>
                    <td><code>34</code></td>
                    <td><code>24</code></td>
                    <td></td>
                    <td><code>00 7B</code></td>
                </tr>
                <tr>
                    <td><kbd>5 %</kbd></td>
                    <td><code>35</code></td>
                    <td><code>25</code></td>
                    <td></td>
                    <td><code>00 7C</code></td>
                </tr>
                <tr>
                    <td><kbd>6 ^</kbd></td>
                    <td><code>36</code></td>
                    <td><code>5E</code></td>
                    <td><code>1E</code></td>
                    <td><code>00 7D</code></td>
                </tr>
                <tr>
                    <td><kbd>7 &amp;</kbd></td>
                    <td><code>37</code></td>
                    <td><code>26</code></td>
                    <td></td>
                    <td><code>00 7E</code></td>
                </tr>
                <tr>
                    <td><kbd>8 *</kbd></td>
                    <td><code>38</code></td>
                    <td><code>2A</code></td>
                    <td></td>
                    <td><code>00 7F</code></td>
                </tr>
                <tr>
                    <td><kbd>9 (</kbd></td>
                    <td><code>39</code></td>
                    <td><code>28</code></td>
                    <td></td>
                    <td><code>00 80</code></td>
                </tr>
                <tr>
                    <td><kbd>0 )</kbd></td>
                    <td><code>30</code></td>
                    <td><code>29</code></td>
                    <td></td>
                    <td><code>00 81</code></td>
                </tr>
                <tr>
                    <td><kbd>- _</kbd></td>
                    <td><code>2D</code></td>
                    <td><code>5F</code></td>
                    <td><code>1F</code></td>
                    <td><code>00 82</code></td>
                </tr>
                <tr>
                    <td><kbd>= +</kbd></td>
                    <td><code>3D</code></td>
                    <td><code>2B</code></td>
                    <td></td>
                    <td><code>00 83</code></td>
                </tr>
                <tr>
                    <td><kbd>Backspace</kbd></td>
                    <td><code>08</code></td>
                    <td><code>08</code></td>
                    <td><code>7F</code></td>
                    <td><code>00 8C</code></td>
                </tr>
                <tr>
                    <td><kbd>Tab</kbd></td>
                    <td><code>09</code></td>
                    <td><code>00 0F</code></td>
                    <td><code>00 8D</code></td>
                    <td><code>00 8E</code></td>
                </tr>
                <tr>
                    <td><kbd>q Q</kbd></td>
                    <td><code>71</code></td>
                    <td><code>51</code></td>
                    <td><code>11</code></td>
                    <td><code>00 10</code></td>
                </tr>
                <tr>
                    <td><kbd>w W</kbd></td>
                    <td><code>77</code></td>
                    <td><code>57</code></td>
                    <td><code>17</code></td>
                    <td><code>00 11</code></td>
                </tr>
                <tr>
                    <td><kbd>e E</kbd></td>
                    <td><code>65</code></td>
                    <td><code>45</code></td>
                    <td><code>05</code></td>
                    <td><code>00 12</code></td>
                </tr>
                <tr>
                    <td><kbd>r R</kbd></td>
                    <td><code>72</code></td>
                    <td><code>52</code></td>
                    <td><code>12</code></td>
                    <td><code>00 13</code></td>
                </tr>
                <tr>
                    <td><kbd>t T</kbd></td>
                    <td><code>74</code></td>
                    <td><code>54</code></td>
                    <td><code>14</code></td>
                    <td><code>00 14</code></td>
                </tr>
                <tr>
                    <td><kbd>y Y</kbd></td>
                    <td><code>79</code></td>
                    <td><code>59</code></td>
                    <td><code>19</code></td>
                    <td><code>00 15</code></td>
                </tr>
                <tr>
                    <td><kbd>u U</kbd></td>
                    <td><code>75</code></td>
                    <td><code>55</code></td>
                    <td><code>15</code></td>
                    <td><code>00 16</code></td>
                </tr>
                <tr>
                    <td><kbd>i I</kbd></td>
                    <td><code>69</code></td>
                    <td><code>49</code></td>
                    <td><code>09</code></td>
                    <td><code>00 17</code></td>
                </tr>
                <tr>
                    <td><kbd>o O</kbd></td>
                    <td><code>6F</code></td>
                    <td><code>4F</code></td>
                    <td><code>0F</code></td>
                    <td><code>00 18</code></td>
                </tr>
                <tr>
                    <td><kbd>p P</kbd></td>
                    <td><code>70</code></td>
                    <td><code>50</code></td>
                    <td><code>10</code></td>
                    <td><code>00 19</code></td>
                </tr>
                <tr>
                    <td><kbd>[ {</kbd></td>
                    <td><code>5B</code></td>
                    <td><code>7B</code></td>
                    <td><code>1B</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>] }</kbd></td>
                    <td><code>5D</code></td>
                    <td><code>7D</code></td>
                    <td><code>1D</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>Enter</kbd></td>
                    <td><code>0D</code></td>
                    <td><code>0D</code></td>
                    <td><code>0A</code></td>
                    <td><code>00 8F</code></td>
                </tr>
                <tr>
                    <td><kbd>a A</kbd></td>
                    <td><code>61</code></td>
                    <td><code>41</code></td>
                    <td><code>01</code></td>
                    <td><code>00 1E</code></td>
                </tr>
                <tr>
                    <td><kbd>s S</kbd></td>
                    <td><code>73</code></td>
                    <td><code>53</code></td>
                    <td><code>13</code></td>
                    <td><code>00 1F</code></td>
                </tr>
                <tr>
                    <td><kbd>d D</kbd></td>
                    <td><code>64</code></td>
                    <td><code>44</code></td>
                    <td><code>04</code></td>
                    <td><code>00 20</code></td>
                </tr>
                <tr>
                    <td><kbd>f F</kbd></td>
                    <td><code>66</code></td>
                    <td><code>46</code></td>
                    <td><code>06</code></td>
                    <td><code>00 21</code></td>
                </tr>
                <tr>
                    <td><kbd>g G</kbd></td>
                    <td><code>67</code></td>
                    <td><code>47</code></td>
                    <td><code>07</code></td>
                    <td><code>00 22</code></td>
                </tr>
                <tr>
                    <td><kbd>h H</kbd></td>
                    <td><code>68</code></td>
                    <td><code>48</code></td>
                    <td><code>08</code></td>
                    <td><code>00 23</code></td>
                </tr>
                <tr>
                    <td><kbd>j J</kbd></td>
                    <td><code>6A</code></td>
                    <td><code>4A</code></td>
                    <td><code>0A</code></td>
                    <td><code>00 24</code></td>
                </tr>
                <tr>
                    <td><kbd>k K</kbd></td>
                    <td><code>6B</code></td>
                    <td><code>4B</code></td>
                    <td><code>0B</code></td>
                    <td><code>00 25</code></td>
                </tr>
                <tr>
                    <td><kbd>l L</kbd></td>
                    <td><code>6C</code></td>
                    <td><code>4C</code></td>
                    <td><code>0C</code></td>
                    <td><code>00 26</code></td>
                </tr>
                <tr>
                    <td><kbd>; :</kbd></td>
                    <td><code>3B</code></td>
                    <td><code>3A</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>' "</kbd></td>
                    <td><code>27</code></td>
                    <td><code>22</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>` ~</kbd></td>
                    <td><code>60</code></td>
                    <td><code>7E</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>\ |</kbd></td>
                    <td><code>5C</code></td>
                    <td><code>7C</code></td>
                    <td><code>1C</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>z Z</kbd></td>
                    <td><code>7A</code></td>
                    <td><code>5A</code></td>
                    <td><code>1A</code></td>
                    <td><code>00 2C</code></td>
                </tr>
                <tr>
                    <td><kbd>x X</kbd></td>
                    <td><code>78</code></td>
                    <td><code>58</code></td>
                    <td><code>18</code></td>
                    <td><code>00 2d</code></td>
                </tr>
                <tr>
                    <td><kbd>c C</kbd></td>
                    <td><code>63</code></td>
                    <td><code>43</code></td>
                    <td><code>03</code></td>
                    <td><code>00 2E</code></td>
                </tr>
                <tr>
                    <td><kbd>v V</kbd></td>
                    <td><code>76</code></td>
                    <td><code>56</code></td>
                    <td><code>16</code></td>
                    <td><code>00 2F</code></td>
                </tr>
                <tr>
                    <td><kbd>b B</kbd></td>
                    <td><code>62</code></td>
                    <td><code>42</code></td>
                    <td><code>02</code></td>
                    <td><code>00 30</code></td>
                </tr>
                <tr>
                    <td><kbd>n N</kbd></td>
                    <td><code>6E</code></td>
                    <td><code>4E</code></td>
                    <td><code>0E</code></td>
                    <td><code>00 31</code></td>
                </tr>
                <tr>
                    <td><kbd>m M</kbd></td>
                    <td><code>6D</code></td>
                    <td><code>4D</code></td>
                    <td><code>0D</code></td>
                    <td><code>00 32</code></td>
                </tr>
                <tr>
                    <td><kbd>, &lt;</kbd></td>
                    <td><code>2C</code></td>
                    <td><code>3C</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>. &gt;</kbd></td>
                    <td><code>2E</code></td>
                    <td><code>3E</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>/ ?</kbd></td>
                    <td><code>2F</code></td>
                    <td><code>3F</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>PrtSc</kbd></td>
                    <td></td>
                    <td></td>
                    <td><code>00 72</code></td>
                    <td><code>00 46</code></td>
                </tr>
                <tr>
                    <td><kbd>Space</kbd></td>
                    <td><code>20</code></td>
                    <td><code>20</code></td>
                    <td><code>20</code></td>
                    <td><code>00 20</code></td>
                </tr>
                <tr>
                    <td><kbd>F1</kbd></td>
                    <td><code>00 3B</code></td>
                    <td><code>00 54</code></td>
                    <td><code>00 5E</code></td>
                    <td><code>00 68</code></td>
                </tr>
                <tr>
                    <td><kbd>F2</kbd></td>
                    <td><code>00 3C</code></td>
                    <td><code>00 55</code></td>
                    <td><code>00 5F</code></td>
                    <td><code>00 69</code></td>
                </tr>
                <tr>
                    <td><kbd>F3</kbd></td>
                    <td><code>00 3D</code></td>
                    <td><code>00 56</code></td>
                    <td><code>00 60</code></td>
                    <td><code>00 6A</code></td>
                </tr>
                <tr>
                    <td><kbd>F4</kbd></td>
                    <td><code>00 3E</code></td>
                    <td><code>00 57</code></td>
                    <td><code>00 61</code></td>
                    <td><code>00 6C</code></td>
                </tr>
                <tr>
                    <td><kbd>F5</kbd></td>
                    <td><code>00 3F</code></td>
                    <td><code>00 58</code></td>
                    <td><code>00 62</code></td>
                    <td><code>00 6D</code></td>
                </tr>
                <tr>
                    <td><kbd>F6</kbd></td>
                    <td><code>00 40</code></td>
                    <td><code>00 59</code></td>
                    <td><code>00 63</code></td>
                    <td><code>00 6E</code></td>
                </tr>
                <tr>
                    <td><kbd>F7</kbd></td>
                    <td><code>00 41</code></td>
                    <td><code>00 5A</code></td>
                    <td><code>00 64</code></td>
                    <td><code>00 6F</code></td>
                </tr>
                <tr>
                    <td><kbd>F8</kbd></td>
                    <td><code>00 42</code></td>
                    <td><code>00 5B</code></td>
                    <td><code>00 65</code></td>
                    <td><code>00 70</code></td>
                </tr>
                <tr>
                    <td><kbd>F9</kbd></td>
                    <td><code>00 43</code></td>
                    <td><code>00 5C</code></td>
                    <td><code>00 66</code></td>
                    <td><code>00 71</code></td>
                </tr>
                <tr>
                    <td><kbd>F10</kbd></td>
                    <td><code>00 44</code></td>
                    <td><code>00 5D</code></td>
                    <td><code>00 67</code></td>
                    <td><code>00 72</code></td>
                </tr>
                <tr>
                    <td><kbd>F11</kbd> (Tandy)</td>
                    <td><code>00 98</code></td>
                    <td><code>00 A2</code></td>
                    <td><code>00 AC</code></td>
                    <td><code>00 B6</code></td>
                </tr>
                <tr>
                    <td><kbd>F12</kbd> (Tandy)</td>
                    <td><code>00 99</code></td>
                    <td><code>00 A3</code></td>
                    <td><code>00 AD</code></td>
                    <td><code>00 B7</code></td>
                </tr>
                <tr>
                    <td><kbd>Home</kbd></td>
                    <td><code>00 47</code></td>
                    <td><code>00 47</code></td>
                    <td><code>00 77</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>End</kbd></td>
                    <td><code>00 4F</code></td>
                    <td><code>00 4F</code></td>
                    <td><code>00 75</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>PgUp</kbd></td>
                    <td><code>00 49</code></td>
                    <td><code>00 49</code></td>
                    <td><code>00 84</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>PgDn</kbd></td>
                    <td><code>00 51</code></td>
                    <td><code>00 51</code></td>
                    <td><code>00 76</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>&#8593;<!--up--></kbd></td>
                    <td><code>00 48</code></td>
                    <td><code>00 48</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>&#8592;<!--left--></kbd></td>
                    <td><code>00 4B</code></td>
                    <td><code>00 87</code></td>
                    <td><code>00 73</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>&#8594;<!--right--></kbd></td>
                    <td><code>00 4D</code></td>
                    <td><code>00 88</code></td>
                    <td><code>00 74</code></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>&#8595;<!--down--></kbd></td>
                    <td><code>00 50</code></td>
                    <td><code>00 50</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>keypad 5</kbd></td>
                    <td><code>35</code></td>
                    <td><code>35</code></td>
                    <td></td>
                    <td><code>05</code></td>
                </tr>
                <tr>
                    <td><kbd>Ins</kbd></td>
                    <td><code>00 52</code></td>
                    <td><code>00 52</code></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><kbd>Del</kbd></td>
                    <td><code>00 53</code></td>
                    <td><code>00 53</code></td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        </div>
    </section>
    <hr>

    <section>
        <h3 id="colours">Colours</h3>
        <p>
            The emulated video adapter can produce more colours than can be shown on the
            screen at one time. These <i>colours</i> can be used by assigning them to <i>attributes</i>
            in a <i>palette</i>.
        </p>
        <h5>CGA palettes</h5>
        <div class="scrollable">
            <table>
                <tr>
                <th rowspan="2">Attribute</th>
                <th colspan="3">Palette 0</th>
                <th colspan="3">Palette 1</th>
                <th colspan="3">Alternate palette</th>
                </tr>
                <tr>
                    <th>Colour</th><th>Lo</th><th>Hi</th>
                    <th>Colour</th><th>Lo</th><th>Hi</th>
                    <th>Colour</th><th>Lo</th><th>Hi</th>
                </tr>
                <tr>
                <td>0</td>
                    <td>Black</td><td style="background-color: #000000;"></td><td style="background-color: #000000;"></td>
                    <td>Black</td><td style="background-color: #000000;"></td><td style="background-color: #000000;"></td>
                    <td>Black</td><td style="background-color: #000000;"></td><td style="background-color: #000000;"></td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>Green</td><td style="background-color: #00aa00;"></td><td style="background-color: #55ff55;"></td>
                    <td>Cyan</td><td style="background-color: #00aaaa;"></td><td style="background-color: #aaffff;"></td>
                    <td>Cyan</td><td style="background-color: #00aaaa;"></td><td style="background-color: #aaffff;"></td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>Red</td><td style="background-color: #aa0000;"></td><td style="background-color: #ff5555;"></td>
                    <td>Magenta</td><td style="background-color: #aa00aa;"></td><td style="background-color: #ff55ff;"></td>
                    <td>Red</td><td style="background-color: #aa0000;"></td><td style="background-color: #ff5555;"></td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>Brown</td><td style="background-color: #aa5500;"></td><td style="background-color: #ffff55;"></td>
                    <td>White</td><td style="background-color: #aaaaaa;"></td><td style="background-color: #ffffff;"></td>
                    <td>White</td><td style="background-color: #aaaaaa;"></td><td style="background-color: #ffffff;"></td>
                </tr>
            </table>
        </div>

        <h5>EGA default palette</h5>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Attribute</th><th>Colour</th><th></th>
                </tr>
                <tr>
                    <td>0</td><td>Black</td><td style="background-color: #000000;"></td>
                </tr>
                <tr>
                    <td>1</td><td>Blue</td><td style="background-color: #0000aa;"></td>
                </tr>
                <tr>
                    <td>2</td><td>Green</td><td style="background-color: #00aa00;"></td>
                </tr>
                <tr>
                    <td>3</td><td>Cyan</td><td style="background-color: #00aaaa;"></td>
                </tr>
                <tr>
                    <td>4</td><td>Red</td><td style="background-color: #aa0000;"></td>
                </tr>
                <tr>
                    <td>5</td><td>Magenta</td><td style="background-color: #aa00aa;"></td>
                </tr>
                <tr>
                    <td>6</td><td>Brown</td><td style="background-color: #aa5500;"></td>
                </tr>
                <tr>
                    <td>7</td><td>Low-intensity white</td><td style="background-color: #aaaaaa;"></td>
                </tr>
                <tr>
                    <td>8</td><td>Grey</td><td style="background-color: #555555;"></td>
                </tr>
                <tr>
                    <td>9</td><td>Light Blue</td><td style="background-color: #5555ff;"></td>
                </tr>
                <tr>
                    <td>10</td><td>Light Green</td><td style="background-color: #55ff55;"></td>
                </tr>
                <tr>
                    <td>11</td><td>Light Cyan</td><td style="background-color: #55ffff;"></td>
                </tr>
                <tr>
                    <td>12</td><td>Light Red</td><td style="background-color: #ff5555;"></td>
                </tr>
                <tr>
                    <td>13</td><td>Light Magenta</td><td style="background-color: #ff55ff;"></td>
                </tr>
                <tr>
                    <td>14</td><td>Light Yellow</td><td style="background-color: #ffff55;"></td>
                </tr>
                <tr>
                    <td>15</td><td>High-intensity white</td><td style="background-color: #ffffff;"></td>
                </tr>
            </table>
        </div>

        <h5>EGA colour list</h5>
        <div class="scrollable">
            <table>
                <tr> <td>0</td><td style="background-color:#000000;"></td> <td>8</td><td style="background-color:#000055;"></td> <td>16</td><td style="background-color:#005500;"></td> <td>24</td><td style="background-color:#005555;"></td> <td>32</td><td style="background-color:#550000;"></td> <td>40</td><td style="background-color:#550055;"></td> <td>48</td><td style="background-color:#555500;"></td> <td>56</td><td style="background-color:#555555;"></td> </tr>
                <tr> <td>1</td><td style="background-color:#0000aa;"></td> <td>9</td><td style="background-color:#0000ff;"></td> <td>17</td><td style="background-color:#0055aa;"></td> <td>25</td><td style="background-color:#0055ff;"></td> <td>33</td><td style="background-color:#5500aa;"></td> <td>41</td><td style="background-color:#5500ff;"></td> <td>49</td><td style="background-color:#5555aa;"></td> <td>57</td><td style="background-color:#5555ff;"></td> </tr>
                <tr> <td>2</td><td style="background-color:#00aa00;"></td> <td>10</td><td style="background-color:#00aa55;"></td> <td>18</td><td style="background-color:#00ff00;"></td> <td>26</td><td style="background-color:#00ff55;"></td> <td>34</td><td style="background-color:#55aa00;"></td> <td>42</td><td style="background-color:#55aa55;"></td> <td>50</td><td style="background-color:#55ff00;"></td> <td>58</td><td style="background-color:#55ff55;"></td> </tr>
                <tr> <td>3</td><td style="background-color:#00aaaa;"></td> <td>11</td><td style="background-color:#00aaff;"></td> <td>19</td><td style="background-color:#00ffaa;"></td> <td>27</td><td style="background-color:#00ffff;"></td> <td>35</td><td style="background-color:#55aaaa;"></td> <td>43</td><td style="background-color:#55aaff;"></td> <td>51</td><td style="background-color:#55ffaa;"></td> <td>59</td><td style="background-color:#55ffff;"></td> </tr>
                <tr> <td>4</td><td style="background-color:#aa0000;"></td> <td>12</td><td style="background-color:#aa0055;"></td> <td>20</td><td style="background-color:#aa5500;"></td> <td>28</td><td style="background-color:#aa5555;"></td> <td>36</td><td style="background-color:#ff0000;"></td> <td>44</td><td style="background-color:#ff0055;"></td> <td>52</td><td style="background-color:#ff5500;"></td> <td>60</td><td style="background-color:#ff5555;"></td> </tr>
                <tr> <td>5</td><td style="background-color:#aa00aa;"></td> <td>13</td><td style="background-color:#aa00ff;"></td> <td>21</td><td style="background-color:#aa55aa;"></td> <td>29</td><td style="background-color:#aa55ff;"></td> <td>37</td><td style="background-color:#ff00aa;"></td> <td>45</td><td style="background-color:#ff00ff;"></td> <td>53</td><td style="background-color:#ff55aa;"></td> <td>61</td><td style="background-color:#ff55ff;"></td> </tr>
                <tr> <td>6</td><td style="background-color:#aaaa00;"></td> <td>14</td><td style="background-color:#aaaa55;"></td> <td>22</td><td style="background-color:#aaff00;"></td> <td>30</td><td style="background-color:#aaff55;"></td> <td>38</td><td style="background-color:#ffaa00;"></td> <td>46</td><td style="background-color:#ffaa55;"></td> <td>54</td><td style="background-color:#ffff00;"></td> <td>62</td><td style="background-color:#ffff55;"></td> </tr>
                <tr> <td>7</td><td style="background-color:#aaaaaa;"></td> <td>15</td><td style="background-color:#aaaaff;"></td> <td>23</td><td style="background-color:#aaffaa;"></td> <td>31</td><td style="background-color:#aaffff;"></td> <td>39</td><td style="background-color:#ffaaaa;"></td> <td>47</td><td style="background-color:#ffaaff;"></td> <td>55</td><td style="background-color:#ffffaa;"></td> <td>63</td><td style="background-color:#ffffff;"></td> </tr>
            </table>
        </div>

        <h5>Textmode attributes (colour)</h5>
        <div class="scrollable">
            <table>
                <tr><th rowspan="2" colspan="2"></th><th colspan="8">Background attribute</th></tr> <tr> <th>0</th> <th>1</th> <th>2</th> <th>3</th> <th>4</th> <th>5</th> <th>6</th> <th>7</th> </tr>
                <tr><th rowspan="32">FG</th>
                     <th>0</th> <td><code>00</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>10</code> <b><span style="color: #000000; background-color:#0000aa;">X</span><span style="color: #000000; background-color:#0000aa;">X</span></b> </td> <td><code>20</code> <b><span style="color: #000000; background-color:#00aa00;">X</span><span style="color: #000000; background-color:#00aa00;">X</span></b> </td> <td><code>30</code> <b><span style="color: #000000; background-color:#00aaaa;">X</span><span style="color: #000000; background-color:#00aaaa;">X</span></b> </td> <td><code>40</code> <b><span style="color: #000000; background-color:#aa0000;">X</span><span style="color: #000000; background-color:#aa0000;">X</span></b> </td> <td><code>50</code> <b><span style="color: #000000; background-color:#aa00aa;">X</span><span style="color: #000000; background-color:#aa00aa;">X</span></b> </td> <td><code>60</code> <b><span style="color: #000000; background-color:#aa5500;">X</span><span style="color: #000000; background-color:#aa5500;">X</span></b> </td> <td><code>70</code> <b><span style="color: #000000; background-color:#aaaaaa;">X</span><span style="color: #000000; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>1</th> <td><code>01</code> <b><span style="color: #0000aa; background-color:#000000;">X</span><span style="color: #0000aa; background-color:#000000;">X</span></b> </td> <td><code>11</code> <b><span style="color: #0000aa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>21</code> <b><span style="color: #0000aa; background-color:#00aa00;">X</span><span style="color: #0000aa; background-color:#00aa00;">X</span></b> </td> <td><code>31</code> <b><span style="color: #0000aa; background-color:#00aaaa;">X</span><span style="color: #0000aa; background-color:#00aaaa;">X</span></b> </td> <td><code>41</code> <b><span style="color: #0000aa; background-color:#aa0000;">X</span><span style="color: #0000aa; background-color:#aa0000;">X</span></b> </td> <td><code>51</code> <b><span style="color: #0000aa; background-color:#aa00aa;">X</span><span style="color: #0000aa; background-color:#aa00aa;">X</span></b> </td> <td><code>61</code> <b><span style="color: #0000aa; background-color:#aa5500;">X</span><span style="color: #0000aa; background-color:#aa5500;">X</span></b> </td> <td><code>71</code> <b><span style="color: #0000aa; background-color:#aaaaaa;">X</span><span style="color: #0000aa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>2</th> <td><code>02</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>12</code> <b><span style="color: #00aa00; background-color:#0000aa;">X</span><span style="color: #00aa00; background-color:#0000aa;">X</span></b> </td> <td><code>22</code> <b><span style="color: #00aa00; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>32</code> <b><span style="color: #00aa00; background-color:#00aaaa;">X</span><span style="color: #00aa00; background-color:#00aaaa;">X</span></b> </td> <td><code>42</code> <b><span style="color: #00aa00; background-color:#aa0000;">X</span><span style="color: #00aa00; background-color:#aa0000;">X</span></b> </td> <td><code>52</code> <b><span style="color: #00aa00; background-color:#aa00aa;">X</span><span style="color: #00aa00; background-color:#aa00aa;">X</span></b> </td> <td><code>62</code> <b><span style="color: #00aa00; background-color:#aa5500;">X</span><span style="color: #00aa00; background-color:#aa5500;">X</span></b> </td> <td><code>72</code> <b><span style="color: #00aa00; background-color:#aaaaaa;">X</span><span style="color: #00aa00; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>3</th> <td><code>03</code> <b><span style="color: #00aaaa; background-color:#000000;">X</span><span style="color: #00aaaa; background-color:#000000;">X</span></b> </td> <td><code>13</code> <b><span style="color: #00aaaa; background-color:#0000aa;">X</span><span style="color: #00aaaa; background-color:#0000aa;">X</span></b> </td> <td><code>23</code> <b><span style="color: #00aaaa; background-color:#00aa00;">X</span><span style="color: #00aaaa; background-color:#00aa00;">X</span></b> </td> <td><code>33</code> <b><span style="color: #00aaaa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>43</code> <b><span style="color: #00aaaa; background-color:#aa0000;">X</span><span style="color: #00aaaa; background-color:#aa0000;">X</span></b> </td> <td><code>53</code> <b><span style="color: #00aaaa; background-color:#aa00aa;">X</span><span style="color: #00aaaa; background-color:#aa00aa;">X</span></b> </td> <td><code>63</code> <b><span style="color: #00aaaa; background-color:#aa5500;">X</span><span style="color: #00aaaa; background-color:#aa5500;">X</span></b> </td> <td><code>73</code> <b><span style="color: #00aaaa; background-color:#aaaaaa;">X</span><span style="color: #00aaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>4</th> <td><code>04</code> <b><span style="color: #aa0000; background-color:#000000;">X</span><span style="color: #aa0000; background-color:#000000;">X</span></b> </td> <td><code>14</code> <b><span style="color: #aa0000; background-color:#0000aa;">X</span><span style="color: #aa0000; background-color:#0000aa;">X</span></b> </td> <td><code>24</code> <b><span style="color: #aa0000; background-color:#00aa00;">X</span><span style="color: #aa0000; background-color:#00aa00;">X</span></b> </td> <td><code>34</code> <b><span style="color: #aa0000; background-color:#00aaaa;">X</span><span style="color: #aa0000; background-color:#00aaaa;">X</span></b> </td> <td><code>44</code> <b><span style="color: #aa0000; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>54</code> <b><span style="color: #aa0000; background-color:#aa00aa;">X</span><span style="color: #aa0000; background-color:#aa00aa;">X</span></b> </td> <td><code>64</code> <b><span style="color: #aa0000; background-color:#aa5500;">X</span><span style="color: #aa0000; background-color:#aa5500;">X</span></b> </td> <td><code>74</code> <b><span style="color: #aa0000; background-color:#aaaaaa;">X</span><span style="color: #aa0000; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>5</th> <td><code>05</code> <b><span style="color: #aa00aa; background-color:#000000;">X</span><span style="color: #aa00aa; background-color:#000000;">X</span></b> </td> <td><code>15</code> <b><span style="color: #aa00aa; background-color:#0000aa;">X</span><span style="color: #aa00aa; background-color:#0000aa;">X</span></b> </td> <td><code>25</code> <b><span style="color: #aa00aa; background-color:#00aa00;">X</span><span style="color: #aa00aa; background-color:#00aa00;">X</span></b> </td> <td><code>35</code> <b><span style="color: #aa00aa; background-color:#00aaaa;">X</span><span style="color: #aa00aa; background-color:#00aaaa;">X</span></b> </td> <td><code>45</code> <b><span style="color: #aa00aa; background-color:#aa0000;">X</span><span style="color: #aa00aa; background-color:#aa0000;">X</span></b> </td> <td><code>55</code> <b><span style="color: #aa00aa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>65</code> <b><span style="color: #aa00aa; background-color:#aa5500;">X</span><span style="color: #aa00aa; background-color:#aa5500;">X</span></b> </td> <td><code>75</code> <b><span style="color: #aa00aa; background-color:#aaaaaa;">X</span><span style="color: #aa00aa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>6</th> <td><code>06</code> <b><span style="color: #aa5500; background-color:#000000;">X</span><span style="color: #aa5500; background-color:#000000;">X</span></b> </td> <td><code>16</code> <b><span style="color: #aa5500; background-color:#0000aa;">X</span><span style="color: #aa5500; background-color:#0000aa;">X</span></b> </td> <td><code>26</code> <b><span style="color: #aa5500; background-color:#00aa00;">X</span><span style="color: #aa5500; background-color:#00aa00;">X</span></b> </td> <td><code>36</code> <b><span style="color: #aa5500; background-color:#00aaaa;">X</span><span style="color: #aa5500; background-color:#00aaaa;">X</span></b> </td> <td><code>46</code> <b><span style="color: #aa5500; background-color:#aa0000;">X</span><span style="color: #aa5500; background-color:#aa0000;">X</span></b> </td> <td><code>56</code> <b><span style="color: #aa5500; background-color:#aa00aa;">X</span><span style="color: #aa5500; background-color:#aa00aa;">X</span></b> </td> <td><code>66</code> <b><span style="color: #aa5500; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>76</code> <b><span style="color: #aa5500; background-color:#aaaaaa;">X</span><span style="color: #aa5500; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>7</th> <td><code>07</code> <b><span style="color: #aaaaaa; background-color:#000000;">X</span><span style="color: #aaaaaa; background-color:#000000;">X</span></b> </td> <td><code>17</code> <b><span style="color: #aaaaaa; background-color:#0000aa;">X</span><span style="color: #aaaaaa; background-color:#0000aa;">X</span></b> </td> <td><code>27</code> <b><span style="color: #aaaaaa; background-color:#00aa00;">X</span><span style="color: #aaaaaa; background-color:#00aa00;">X</span></b> </td> <td><code>37</code> <b><span style="color: #aaaaaa; background-color:#00aaaa;">X</span><span style="color: #aaaaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>47</code> <b><span style="color: #aaaaaa; background-color:#aa0000;">X</span><span style="color: #aaaaaa; background-color:#aa0000;">X</span></b> </td> <td><code>57</code> <b><span style="color: #aaaaaa; background-color:#aa00aa;">X</span><span style="color: #aaaaaa; background-color:#aa00aa;">X</span></b> </td> <td><code>67</code> <b><span style="color: #aaaaaa; background-color:#aa5500;">X</span><span style="color: #aaaaaa; background-color:#aa5500;">X</span></b> </td> <td><code>77</code> <b><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>8</th> <td><code>08</code> <b><span style="color: #555555; background-color:#000000;">X</span><span style="color: #555555; background-color:#000000;">X</span></b> </td> <td><code>18</code> <b><span style="color: #555555; background-color:#0000aa;">X</span><span style="color: #555555; background-color:#0000aa;">X</span></b> </td> <td><code>28</code> <b><span style="color: #555555; background-color:#00aa00;">X</span><span style="color: #555555; background-color:#00aa00;">X</span></b> </td> <td><code>38</code> <b><span style="color: #555555; background-color:#00aaaa;">X</span><span style="color: #555555; background-color:#00aaaa;">X</span></b> </td> <td><code>48</code> <b><span style="color: #555555; background-color:#aa0000;">X</span><span style="color: #555555; background-color:#aa0000;">X</span></b> </td> <td><code>58</code> <b><span style="color: #555555; background-color:#aa00aa;">X</span><span style="color: #555555; background-color:#aa00aa;">X</span></b> </td> <td><code>68</code> <b><span style="color: #555555; background-color:#aa5500;">X</span><span style="color: #555555; background-color:#aa5500;">X</span></b> </td> <td><code>78</code> <b><span style="color: #555555; background-color:#aaaaaa;">X</span><span style="color: #555555; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>9</th> <td><code>09</code> <b><span style="color: #5555ff; background-color:#000000;">X</span><span style="color: #5555ff; background-color:#000000;">X</span></b> </td> <td><code>19</code> <b><span style="color: #5555ff; background-color:#0000aa;">X</span><span style="color: #5555ff; background-color:#0000aa;">X</span></b> </td> <td><code>29</code> <b><span style="color: #5555ff; background-color:#00aa00;">X</span><span style="color: #5555ff; background-color:#00aa00;">X</span></b> </td> <td><code>39</code> <b><span style="color: #5555ff; background-color:#00aaaa;">X</span><span style="color: #5555ff; background-color:#00aaaa;">X</span></b> </td> <td><code>49</code> <b><span style="color: #5555ff; background-color:#aa0000;">X</span><span style="color: #5555ff; background-color:#aa0000;">X</span></b> </td> <td><code>59</code> <b><span style="color: #5555ff; background-color:#aa00aa;">X</span><span style="color: #5555ff; background-color:#aa00aa;">X</span></b> </td> <td><code>69</code> <b><span style="color: #5555ff; background-color:#aa5500;">X</span><span style="color: #5555ff; background-color:#aa5500;">X</span></b> </td> <td><code>79</code> <b><span style="color: #5555ff; background-color:#aaaaaa;">X</span><span style="color: #5555ff; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>10</th> <td><code>0a</code> <b><span style="color: #55ff55; background-color:#000000;">X</span><span style="color: #55ff55; background-color:#000000;">X</span></b> </td> <td><code>1a</code> <b><span style="color: #55ff55; background-color:#0000aa;">X</span><span style="color: #55ff55; background-color:#0000aa;">X</span></b> </td> <td><code>2a</code> <b><span style="color: #55ff55; background-color:#00aa00;">X</span><span style="color: #55ff55; background-color:#00aa00;">X</span></b> </td> <td><code>3a</code> <b><span style="color: #55ff55; background-color:#00aaaa;">X</span><span style="color: #55ff55; background-color:#00aaaa;">X</span></b> </td> <td><code>4a</code> <b><span style="color: #55ff55; background-color:#aa0000;">X</span><span style="color: #55ff55; background-color:#aa0000;">X</span></b> </td> <td><code>5a</code> <b><span style="color: #55ff55; background-color:#aa00aa;">X</span><span style="color: #55ff55; background-color:#aa00aa;">X</span></b> </td> <td><code>6a</code> <b><span style="color: #55ff55; background-color:#aa5500;">X</span><span style="color: #55ff55; background-color:#aa5500;">X</span></b> </td> <td><code>7a</code> <b><span style="color: #55ff55; background-color:#aaaaaa;">X</span><span style="color: #55ff55; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>11</th> <td><code>0b</code> <b><span style="color: #55ffff; background-color:#000000;">X</span><span style="color: #55ffff; background-color:#000000;">X</span></b> </td> <td><code>1b</code> <b><span style="color: #55ffff; background-color:#0000aa;">X</span><span style="color: #55ffff; background-color:#0000aa;">X</span></b> </td> <td><code>2b</code> <b><span style="color: #55ffff; background-color:#00aa00;">X</span><span style="color: #55ffff; background-color:#00aa00;">X</span></b> </td> <td><code>3b</code> <b><span style="color: #55ffff; background-color:#00aaaa;">X</span><span style="color: #55ffff; background-color:#00aaaa;">X</span></b> </td> <td><code>4b</code> <b><span style="color: #55ffff; background-color:#aa0000;">X</span><span style="color: #55ffff; background-color:#aa0000;">X</span></b> </td> <td><code>5b</code> <b><span style="color: #55ffff; background-color:#aa00aa;">X</span><span style="color: #55ffff; background-color:#aa00aa;">X</span></b> </td> <td><code>6b</code> <b><span style="color: #55ffff; background-color:#aa5500;">X</span><span style="color: #55ffff; background-color:#aa5500;">X</span></b> </td> <td><code>7b</code> <b><span style="color: #55ffff; background-color:#aaaaaa;">X</span><span style="color: #55ffff; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>12</th> <td><code>0c</code> <b><span style="color: #ff5555; background-color:#000000;">X</span><span style="color: #ff5555; background-color:#000000;">X</span></b> </td> <td><code>1c</code> <b><span style="color: #ff5555; background-color:#0000aa;">X</span><span style="color: #ff5555; background-color:#0000aa;">X</span></b> </td> <td><code>2c</code> <b><span style="color: #ff5555; background-color:#00aa00;">X</span><span style="color: #ff5555; background-color:#00aa00;">X</span></b> </td> <td><code>3c</code> <b><span style="color: #ff5555; background-color:#00aaaa;">X</span><span style="color: #ff5555; background-color:#00aaaa;">X</span></b> </td> <td><code>4c</code> <b><span style="color: #ff5555; background-color:#aa0000;">X</span><span style="color: #ff5555; background-color:#aa0000;">X</span></b> </td> <td><code>5c</code> <b><span style="color: #ff5555; background-color:#aa00aa;">X</span><span style="color: #ff5555; background-color:#aa00aa;">X</span></b> </td> <td><code>6c</code> <b><span style="color: #ff5555; background-color:#aa5500;">X</span><span style="color: #ff5555; background-color:#aa5500;">X</span></b> </td> <td><code>7c</code> <b><span style="color: #ff5555; background-color:#aaaaaa;">X</span><span style="color: #ff5555; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>13</th> <td><code>0d</code> <b><span style="color: #ff55ff; background-color:#000000;">X</span><span style="color: #ff55ff; background-color:#000000;">X</span></b> </td> <td><code>1d</code> <b><span style="color: #ff55ff; background-color:#0000aa;">X</span><span style="color: #ff55ff; background-color:#0000aa;">X</span></b> </td> <td><code>2d</code> <b><span style="color: #ff55ff; background-color:#00aa00;">X</span><span style="color: #ff55ff; background-color:#00aa00;">X</span></b> </td> <td><code>3d</code> <b><span style="color: #ff55ff; background-color:#00aaaa;">X</span><span style="color: #ff55ff; background-color:#00aaaa;">X</span></b> </td> <td><code>4d</code> <b><span style="color: #ff55ff; background-color:#aa0000;">X</span><span style="color: #ff55ff; background-color:#aa0000;">X</span></b> </td> <td><code>5d</code> <b><span style="color: #ff55ff; background-color:#aa00aa;">X</span><span style="color: #ff55ff; background-color:#aa00aa;">X</span></b> </td> <td><code>6d</code> <b><span style="color: #ff55ff; background-color:#aa5500;">X</span><span style="color: #ff55ff; background-color:#aa5500;">X</span></b> </td> <td><code>7d</code> <b><span style="color: #ff55ff; background-color:#aaaaaa;">X</span><span style="color: #ff55ff; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>14</th> <td><code>0e</code> <b><span style="color: #ffff55; background-color:#000000;">X</span><span style="color: #ffff55; background-color:#000000;">X</span></b> </td> <td><code>1e</code> <b><span style="color: #ffff55; background-color:#0000aa;">X</span><span style="color: #ffff55; background-color:#0000aa;">X</span></b> </td> <td><code>2e</code> <b><span style="color: #ffff55; background-color:#00aa00;">X</span><span style="color: #ffff55; background-color:#00aa00;">X</span></b> </td> <td><code>3e</code> <b><span style="color: #ffff55; background-color:#00aaaa;">X</span><span style="color: #ffff55; background-color:#00aaaa;">X</span></b> </td> <td><code>4e</code> <b><span style="color: #ffff55; background-color:#aa0000;">X</span><span style="color: #ffff55; background-color:#aa0000;">X</span></b> </td> <td><code>5e</code> <b><span style="color: #ffff55; background-color:#aa00aa;">X</span><span style="color: #ffff55; background-color:#aa00aa;">X</span></b> </td> <td><code>6e</code> <b><span style="color: #ffff55; background-color:#aa5500;">X</span><span style="color: #ffff55; background-color:#aa5500;">X</span></b> </td> <td><code>7e</code> <b><span style="color: #ffff55; background-color:#aaaaaa;">X</span><span style="color: #ffff55; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>15</th> <td><code>0f</code> <b><span style="color: #ffffff; background-color:#000000;">X</span><span style="color: #ffffff; background-color:#000000;">X</span></b> </td> <td><code>1f</code> <b><span style="color: #ffffff; background-color:#0000aa;">X</span><span style="color: #ffffff; background-color:#0000aa;">X</span></b> </td> <td><code>2f</code> <b><span style="color: #ffffff; background-color:#00aa00;">X</span><span style="color: #ffffff; background-color:#00aa00;">X</span></b> </td> <td><code>3f</code> <b><span style="color: #ffffff; background-color:#00aaaa;">X</span><span style="color: #ffffff; background-color:#00aaaa;">X</span></b> </td> <td><code>4f</code> <b><span style="color: #ffffff; background-color:#aa0000;">X</span><span style="color: #ffffff; background-color:#aa0000;">X</span></b> </td> <td><code>5f</code> <b><span style="color: #ffffff; background-color:#aa00aa;">X</span><span style="color: #ffffff; background-color:#aa00aa;">X</span></b> </td> <td><code>6f</code> <b><span style="color: #ffffff; background-color:#aa5500;">X</span><span style="color: #ffffff; background-color:#aa5500;">X</span></b> </td> <td><code>7f</code> <b><span style="color: #ffffff; background-color:#aaaaaa;">X</span><span style="color: #ffffff; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>16</th> <td><code>80</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>90</code> <b><span style="color: #000000; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a0</code> <b><span style="color: #000000; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b0</code> <b><span style="color: #000000; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c0</code> <b><span style="color: #000000; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d0</code> <b><span style="color: #000000; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e0</code> <b><span style="color: #000000; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f0</code> <b><span style="color: #000000; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>17</th> <td><code>81</code> <b><span style="color: #0000aa; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>91</code> <b><span style="color: #0000aa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a1</code> <b><span style="color: #0000aa; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b1</code> <b><span style="color: #0000aa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c1</code> <b><span style="color: #0000aa; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d1</code> <b><span style="color: #0000aa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e1</code> <b><span style="color: #0000aa; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f1</code> <b><span style="color: #0000aa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>18</th> <td><code>82</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>92</code> <b><span style="color: #00aa00; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a2</code> <b><span style="color: #00aa00; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b2</code> <b><span style="color: #00aa00; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c2</code> <b><span style="color: #00aa00; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d2</code> <b><span style="color: #00aa00; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e2</code> <b><span style="color: #00aa00; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f2</code> <b><span style="color: #00aa00; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>19</th> <td><code>83</code> <b><span style="color: #00aaaa; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>93</code> <b><span style="color: #00aaaa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a3</code> <b><span style="color: #00aaaa; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b3</code> <b><span style="color: #00aaaa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c3</code> <b><span style="color: #00aaaa; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d3</code> <b><span style="color: #00aaaa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e3</code> <b><span style="color: #00aaaa; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f3</code> <b><span style="color: #00aaaa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>20</th> <td><code>84</code> <b><span style="color: #aa0000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>94</code> <b><span style="color: #aa0000; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a4</code> <b><span style="color: #aa0000; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b4</code> <b><span style="color: #aa0000; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c4</code> <b><span style="color: #aa0000; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d4</code> <b><span style="color: #aa0000; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e4</code> <b><span style="color: #aa0000; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f4</code> <b><span style="color: #aa0000; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>21</th> <td><code>85</code> <b><span style="color: #aa00aa; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>95</code> <b><span style="color: #aa00aa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a5</code> <b><span style="color: #aa00aa; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b5</code> <b><span style="color: #aa00aa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c5</code> <b><span style="color: #aa00aa; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d5</code> <b><span style="color: #aa00aa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e5</code> <b><span style="color: #aa00aa; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f5</code> <b><span style="color: #aa00aa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>22</th> <td><code>86</code> <b><span style="color: #aa5500; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>96</code> <b><span style="color: #aa5500; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a6</code> <b><span style="color: #aa5500; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b6</code> <b><span style="color: #aa5500; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c6</code> <b><span style="color: #aa5500; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d6</code> <b><span style="color: #aa5500; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e6</code> <b><span style="color: #aa5500; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f6</code> <b><span style="color: #aa5500; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>23</th> <td><code>87</code> <b><span style="color: #aaaaaa; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>97</code> <b><span style="color: #aaaaaa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a7</code> <b><span style="color: #aaaaaa; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b7</code> <b><span style="color: #aaaaaa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c7</code> <b><span style="color: #aaaaaa; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d7</code> <b><span style="color: #aaaaaa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e7</code> <b><span style="color: #aaaaaa; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f7</code> <b><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>24</th> <td><code>88</code> <b><span style="color: #555555; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>98</code> <b><span style="color: #555555; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a8</code> <b><span style="color: #555555; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b8</code> <b><span style="color: #555555; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c8</code> <b><span style="color: #555555; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d8</code> <b><span style="color: #555555; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e8</code> <b><span style="color: #555555; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f8</code> <b><span style="color: #555555; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>25</th> <td><code>89</code> <b><span style="color: #5555ff; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>99</code> <b><span style="color: #5555ff; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a9</code> <b><span style="color: #5555ff; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b9</code> <b><span style="color: #5555ff; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c9</code> <b><span style="color: #5555ff; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d9</code> <b><span style="color: #5555ff; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e9</code> <b><span style="color: #5555ff; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f9</code> <b><span style="color: #5555ff; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>26</th> <td><code>8a</code> <b><span style="color: #55ff55; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9a</code> <b><span style="color: #55ff55; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>aa</code> <b><span style="color: #55ff55; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>ba</code> <b><span style="color: #55ff55; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>ca</code> <b><span style="color: #55ff55; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>da</code> <b><span style="color: #55ff55; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ea</code> <b><span style="color: #55ff55; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fa</code> <b><span style="color: #55ff55; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>27</th> <td><code>8b</code> <b><span style="color: #55ffff; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9b</code> <b><span style="color: #55ffff; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>ab</code> <b><span style="color: #55ffff; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>bb</code> <b><span style="color: #55ffff; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>cb</code> <b><span style="color: #55ffff; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>db</code> <b><span style="color: #55ffff; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>eb</code> <b><span style="color: #55ffff; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fb</code> <b><span style="color: #55ffff; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>28</th> <td><code>8c</code> <b><span style="color: #ff5555; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9c</code> <b><span style="color: #ff5555; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>ac</code> <b><span style="color: #ff5555; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>bc</code> <b><span style="color: #ff5555; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>cc</code> <b><span style="color: #ff5555; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>dc</code> <b><span style="color: #ff5555; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ec</code> <b><span style="color: #ff5555; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fc</code> <b><span style="color: #ff5555; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>29</th> <td><code>8d</code> <b><span style="color: #ff55ff; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9d</code> <b><span style="color: #ff55ff; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>ad</code> <b><span style="color: #ff55ff; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>bd</code> <b><span style="color: #ff55ff; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>cd</code> <b><span style="color: #ff55ff; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>dd</code> <b><span style="color: #ff55ff; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ed</code> <b><span style="color: #ff55ff; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fd</code> <b><span style="color: #ff55ff; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>30</th> <td><code>8e</code> <b><span style="color: #ffff55; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9e</code> <b><span style="color: #ffff55; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>ae</code> <b><span style="color: #ffff55; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>be</code> <b><span style="color: #ffff55; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>ce</code> <b><span style="color: #ffff55; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>de</code> <b><span style="color: #ffff55; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ee</code> <b><span style="color: #ffff55; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fe</code> <b><span style="color: #ffff55; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>31</th> <td><code>8f</code> <b><span style="color: #ffffff; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9f</code> <b><span style="color: #ffffff; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>af</code> <b><span style="color: #ffffff; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>bf</code> <b><span style="color: #ffffff; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>cf</code> <b><span style="color: #ffffff; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>df</code> <b><span style="color: #ffffff; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ef</code> <b><span style="color: #ffffff; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>ff</code> <b><span style="color: #ffffff; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
            </table>
        </div>

        <h5>Textmode attributes (monochrome)</h5>
        <div class="scrollable">
            <table>
                <tr><th rowspan="2" colspan="2"></th><th colspan="8">Background attribute</th></tr> <tr> <th>0</th> <th>1</th> <th>2</th> <th>3</th> <th>4</th> <th>5</th> <th>6</th> <th>7</th> </tr>
                <tr><th rowspan="32">FG</th>
                     <th>0</th> <td><code>00</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>10</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>20</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>30</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>40</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>50</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>60</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>70</code> <b><span style="color: #000000; background-color:#00aa00;">X</span><span style="color: #000000; background-color:#00aa00;">X</span></b> </td> </tr>
                <tr> <th>1</th> <td><code>01</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>11</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>21</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>31</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>41</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>51</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>61</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>71</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> </tr>
                <tr> <th>2</th> <td><code>02</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>12</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>22</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>32</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>42</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>52</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>62</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>72</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>3</th> <td><code>03</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>13</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>23</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>33</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>43</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>53</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>63</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>73</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>4</th> <td><code>04</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>14</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>24</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>34</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>44</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>54</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>64</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>74</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>5</th> <td><code>05</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>15</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>25</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>35</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>45</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>55</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>65</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>75</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>6</th> <td><code>06</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>16</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>26</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>36</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>46</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>56</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>66</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>76</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>7</th> <td><code>07</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>17</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>27</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>37</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>47</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>57</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>67</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>77</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>8</th> <td><code>08</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>18</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>28</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>38</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>48</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>58</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>68</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>78</code> <b><span style="color: #005500; background-color:#00aa00;">X</span><span style="color: #005500; background-color:#00aa00;">X</span></b> </td> </tr>
                <tr> <th>9</th> <td><code>09</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>19</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>29</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>39</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>49</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>59</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>69</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>79</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> </tr>
                <tr> <th>10</th> <td><code>0a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>11</th> <td><code>0b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>12</th> <td><code>0c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>13</th> <td><code>0d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>14</th> <td><code>0e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>15</th> <td><code>0f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>16</th> <td><code>80</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>90</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f0</code> <b><span style="color: #000000; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> </tr>
                <tr> <th>17</th> <td><code>81</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>91</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>a1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>b1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>c1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>d1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>e1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>f1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> </tr>
                <tr> <th>18</th> <td><code>82</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>92</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>19</th> <td><code>83</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>93</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>20</th> <td><code>84</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>94</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>21</th> <td><code>85</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>95</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>22</th> <td><code>86</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>96</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>23</th> <td><code>87</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>97</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>24</th> <td><code>88</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>98</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f8</code> <b><span style="color: #005500; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> </tr>
                <tr> <th>25</th> <td><code>89</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>99</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>a9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>b9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>c9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>d9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>e9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>f9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> </tr>
                <tr> <th>26</th> <td><code>8a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>aa</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ba</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ca</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>da</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ea</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fa</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>27</th> <td><code>8b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ab</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>bb</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>cb</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>db</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>eb</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fb</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>28</th> <td><code>8c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ac</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>bc</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>cc</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>dc</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ec</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fc</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>29</th> <td><code>8d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ad</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>bd</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>cd</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>dd</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ed</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fd</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>30</th> <td><code>8e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ae</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>be</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ce</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>de</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ee</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fe</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>31</th> <td><code>8f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>af</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>bf</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>cf</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>df</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ef</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ff</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
            </table>
        </div>
    </section>
    <hr>
</article>
<article>
<h2 id="acks_acknowledgements">Acknowledgements</h2>
<h3 id="acks_contributors">Contributors</h3>
<p>PC-BASIC would not exist without those contributing code, reporting bugs,
sending in patches, and documenting GW-BASIC's behaviour. Thank you all!</p>
<ul>
<li><strong>Rob Hagemans</strong>,   lead author</li>
<li><strong>Wengier Wu</strong>,     bug fixes, advice for CJK support</li>
<li><strong>WJB</strong>,            bug fixes</li>
<li><strong>Ronald Herrera</strong>, testing, bug hunting</li>
<li><strong>Miguel Dorta</strong>,   testing, serial ports</li>
<li><strong>Patrik</strong>,         testing, serial ports</li>
<li><strong>Duane</strong>,          testing, serial ports</li>
</ul>
<h3 id="acks_shoulders-of-giants">Shoulders of Giants</h3>
<p>PC-BASIC depends on the following open-source projects:</p>
<ul>
<li><a href="http://www.python.org">Python</a></li>
<li><a href="http://www.libsdl.org">Simple DirectMedia Layer (SDL)</a></li>
<li><a href="https://pysdl2.readthedocs.org/en/latest/">PySDL2</a></li>
<li><a href="http://www.numpy.org">NumPy</a></li>
<li><a href="https://sourceforge.net/projects/pywin32/">Python for Windows Extensions (PyWin32)</a></li>
<li><a href="http://pyserial.sourceforge.net/pyserial.html">PySerial</a></li>
<li><a href="http://pexpect.readthedocs.org/en/latest/">PExpect</a></li>
<li><a href="https://github.com/robhagemans/ansipipe">ANSI|pipe</a></li>
</ul>
<h3 id="acks_fond-memories">Fond memories</h3>
<p>PC-BASIC would not have been what it is without the following open-source projects
which it has depended on in the past:</p>
<ul>
<li><a href="http://www.pygame.org">PyGame</a></li>
<li><strong>Tom Rothamel</strong>'s <a href="https://web.archive.org/web/20150712040220/http://pygame.renpy.org/">PyGame Subset for Android</a> (superseded by <a href="http://www.renpy.org/doc/html/android.html">RAPT</a>)</li>
</ul>
<h3 id="acks_technical-documentation">Technical Documentation</h3>
<p>Building PC-BASIC would have been impossible without the immense amounts of
technical documentation that has been made available online. It has proven not
to be feasible to compile a complete list of the documentation used. Many
thanks to all those who make technical information freely available, and
apologies to those whose contribution I have failed to acknowledge here.</p>
<h5 id="acks_gw-basic-tokenised-file-format">GW-BASIC tokenised file format</h5>
<ul>
<li><strong>Norman De Forest</strong>'s seminal <a href="http://www.chebucto.ns.ca/~af380/GW-BASIC-tokens.html">documentation of GW-BASIC tokens</a>.
    <em>This documentation was the starting point for the development of PC-BASIC.</em></li>
<li><strong>Dan Vanderkam</strong>'s <a href="http://www.danvk.org/wp/2008-02-03/reading-old-gw-basic-programs/">online GW-BASIC decoder</a></li>
</ul>
<h5 id="acks_gw-basic-protected-file-format">GW-BASIC protected file format</h5>
<ul>
<li><strong>Paul Kocher</strong>, <em>The Cryptogram computer supplement</em> <strong>19</strong>, American Cryptogram Association, Summer 1994</li>
</ul>
<h5 id="acks_video-hardware">Video hardware</h5>
<ul>
<li><strong>John Elliott</strong>'s <a href="http://www.seasip.info/VintagePC/">Vintage PC pages</a></li>
<li><strong>Dan Rollins</strong>' <a href="http://webpages.charter.net/danrollins/techhelp/0089.HTM">TechHelp</a> pages on PC video memory layout</li>
<li><strong>Great Hierophant</strong>'s <a href="http://nerdlypleasures.blogspot.com">Nerdly Pleasures Blog</a></li>
</ul>
<h5 id="acks_microsoft-binary-format">Microsoft Binary Format</h5>
<ul>
<li>Forum contributions by <strong><a href="http://www.boyet.com/Articles/MBFSinglePrecision.html">Julian Brucknall</a></strong> and <strong><a href="http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20245266.html">Adam Burgoyne</a></strong></li>
</ul>
<h5 id="acks_data-cassette-format">Data cassette format</h5>
<ul>
<li><strong>Mike Brutman</strong>'s <a href="http://www.brutman.com/Cassette_Waveforms/Cassette_Waveforms.html">Analysis of the IBM PC Data cassette format</a></li>
<li><strong>Dan Tobias</strong>' <a href="http://fileformats.archiveteam.org/wiki/IBM_PC_data_cassette">IBM PC Data cassette format documentation</a></li>
</ul>
<h5 id="acks_basicode">BASICODE</h5>
<ul>
<li><strong>Janny Looyenga</strong>'s documentation of the <a href="http://www.nostalgia8.nl/basicode.htm">BASICODE format</a></li>
</ul>
<h5 id="acks_technical-information-on-many-topics">Technical information on many topics</h5>
<ul>
<li><a href="http://www.vogons.org/">VOGONS</a></li>
<li><strong>Erik S. Klein</strong>'s <a href="http://www.vintage-computer.com">Vintage computer forums</a></li>
<li><strong>Peter Berg</strong>'s <a href="http://www.petesqbsite.com/">Pete's QBasic/QuickBasic site</a></li>
</ul>
<h3 id="acks_fonts">Fonts</h3>
<ul>
<li><strong>Henrique Peron</strong>'s <a href="http://www.freedos.org/software/?prog=cpidos">CPIDOS codepage pack</a></li>
<li><strong>Dmitry Bolkhovityanov</strong>'s <a href="http://www.inp.nsk.su/~bolkhov/files/fonts/univga/">Uni-VGA font</a></li>
<li><strong>Roman Czyborra</strong>, <strong>Qianqian Fang</strong> and others' <a href="https://savannah.gnu.org/projects/unifont">GNU UniFont</a></li>
<li><a href="http://www.dosbox.com">DOSBox</a> VGA fonts</li>
<li><strong>Andries Brouwer</strong>'s <a href="http://www.win.tue.nl/~aeb/linux/kbd/font-formats-3.html">CPI font file format documentation</a></li>
</ul>
<h3 id="acks_unicode-codepage-mappings">Unicode-codepage mappings</h3>
<ul>
<li><a href="http://www.unicode.org/Public/MAPPINGS/VENDORS">The Unicode Consortium and contributors</a></li>
<li><a href="https://www.gnu.org/software/libiconv/">GNU libiconv Project</a></li>
<li><a href="http://www.aivosto.com/vbtips/charsets-codepages.html">Aivosto</a></li>
<li><strong>Konstantinos Kostis</strong>' <a href="http://www.kostis.net/charsets/">Charsets Index</a></li>
<li><a href="http://www-01.ibm.com/software/globalization/cdra/">IBM CDRA</a></li>
<li><strong>Masaki Tojo</strong>'s <a href="https://github.com/mtojo/camellia">Camellia</a></li>
</ul>
<h3 id="acks_development-tools">Development tools</h3>
<p>PC-BASIC is developed using <a href="https://git-scm.com/">Git</a> source control,
<a href="https://wiki.gnome.org/Apps/Gedit">GEdit</a> and <a href="https://atom.io/">Atom</a> text
editors on an <a href="http://www.ubuntu.com/">Ubuntu</a> Linux system and hosted on
<a href="https://github.com/">GitHub</a> and <a href="https://sourceforge.net/">SourceForge</a>.</p>
<p>Packaging and documentation depends on the following projects:</p>
<ul>
<li><a href="http://www.pyinstaller.org">PyInstaller</a></li>
<li><a href="http://nsis.sourceforge.net">Nullsoft Scriptable Install System</a></li>
<li><a href="http://www.7-zip.org">7-Zip</a></li>
<li><a href="http://www.gnu.org/">The GNU Base System</a></li>
<li><a href="http://lxml.de">LXML</a></li>
<li><a href="https://pypi.python.org/pypi/Markdown">Markdown</a></li>
</ul>
<h3 id="acks_emulators">Emulators</h3>
<p>These excellent emulators have been indispensable tools in documenting the
behaviour of various Microsoft BASIC dialects.</p>
<ul>
<li><a href="http://www.dosbox.com">DOSBox</a></li>
<li><a href="http://www.mess.org">MESS</a></li>
<li><a href="http://www.hampa.ch/pce/">PCE PC Emulator</a></li>
</ul></article>
<footer>
<h2 id="licence">Licences</h2>
<h3 id="pc-basic-interpreter">PC-BASIC interpreter</h3>
<p><strong>Copyright &#169; 2013&#8212;2015 Rob Hagemans.</strong></p>
<p><em>Source code available at <a href="https://github.com/robhagemans/pcbasic">https://github.com/robhagemans/pcbasic</a>.</em></p>
<p>This program is free software; you can redistribute it and/or modify
it under the terms of the <a href="http://www.gnu.org/licenses/gpl-3.0.en.html">GNU General Public License, Version 3</a>,
as published by the Free Software Foundation.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</p><hr>
<h3 id="pc-basic-documentation">PC-BASIC documentation</h3>
<p><strong>Copyright &#169; 2014&#8212;2015 Rob Hagemans.</strong></p>
<p>This work is licensed under a
<a href="http://creativecommons.org/licenses/by-sa/4.0/legalcode">Creative Commons Attribution-ShareAlike 4.0 International License</a>.</p>
</footer>
</body>
</html>